diff options
author | unknown <jani@ua141d10.elisa.omakaista.fi> | 2007-01-25 20:10:31 +0200 |
---|---|---|
committer | unknown <jani@ua141d10.elisa.omakaista.fi> | 2007-01-25 20:10:31 +0200 |
commit | 2ec2fa6d08b9720307e8bc85aaa797fd05b565a2 (patch) | |
tree | cb5306aa3b4e8ff2601826fc23c817fbc370292b /include | |
parent | 454c763c6be44b34c8e1ff9b8561ab21e717b742 (diff) | |
download | mariadb-git-2ec2fa6d08b9720307e8bc85aaa797fd05b565a2.tar.gz |
Cleanup of thread-type (linuxthread or NTPL) detection code
Move get_thread_lib to mysys/my_pthread.c
Set 'thr_client_alarm' to signal number used by thr_alarm to give alarms
include/my_global.h:
Fixed to be same as in 5.1
include/my_pthread.h:
Move things around to be more in line with rest of code
include/thr_alarm.h:
extern of thr_client_alarm
mysys/default.c:
Fixed two wrong pointer incrementations.
mysys/my_pthread.c:
Cleanup: Use variable thr_client_alarm
mysys/my_thr_init.c:
Detect thread library at startup
mysys/thr_alarm.c:
Set thr_client_alarm depending on which thread library we are using
sql/mysqld.cc:
Move get_thread_lib to mysys/my_pthread.c
Diffstat (limited to 'include')
-rw-r--r-- | include/my_global.h | 5 | ||||
-rw-r--r-- | include/my_pthread.h | 16 | ||||
-rw-r--r-- | include/thr_alarm.h | 2 |
3 files changed, 11 insertions, 12 deletions
diff --git a/include/my_global.h b/include/my_global.h index e6bf9a9b840..f0e600e386d 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -348,10 +348,7 @@ int __void__; #endif /* Define some useful general macros */ -#if defined(__cplusplus) && defined(__GNUC__) -#define max(a, b) ((a) >? (b)) -#define min(a, b) ((a) <? (b)) -#elif !defined(max) +#if !defined(max) #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) #endif diff --git a/include/my_pthread.h b/include/my_pthread.h index e1a7ecab4ab..9d5e78bba44 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -28,14 +28,6 @@ extern "C" { #endif /* __cplusplus */ -/* Thread library */ - -#define THD_LIB_OTHER 1 -#define THD_LIB_NPTL 2 -#define THD_LIB_LT 4 - -extern uint thd_lib_detected; - #if defined(__WIN__) || defined(OS2) #ifdef OS2 @@ -684,6 +676,14 @@ extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const)); */ extern pthread_t shutdown_th, main_th, signal_th; +/* Which kind of thread library is in use */ + +#define THD_LIB_OTHER 1 +#define THD_LIB_NPTL 2 +#define THD_LIB_LT 4 + +extern uint thd_lib_detected; + /* statistics_xxx functions are for not essential statistic */ #ifndef thread_safe_increment diff --git a/include/thr_alarm.h b/include/thr_alarm.h index 0c26a67acf4..ef6aaf49f77 100644 --- a/include/thr_alarm.h +++ b/include/thr_alarm.h @@ -93,6 +93,8 @@ typedef struct st_alarm { my_bool malloced; } ALARM; +extern uint thr_client_alarm; + #define thr_alarm_init(A) (*(A))=0 #define thr_alarm_in_use(A) (*(A)!= 0) void init_thr_alarm(uint max_alarm); |