diff options
author | jani@ua141d10.elisa.omakaista.fi <> | 2007-01-25 20:10:31 +0200 |
---|---|---|
committer | jani@ua141d10.elisa.omakaista.fi <> | 2007-01-25 20:10:31 +0200 |
commit | 0b4ee9e5b8cee5af84295d76345d917788ebe294 (patch) | |
tree | cb5306aa3b4e8ff2601826fc23c817fbc370292b /include | |
parent | ff58749b290dc8f5f8e78ce7b5a73d7efecc610a (diff) | |
download | mariadb-git-0b4ee9e5b8cee5af84295d76345d917788ebe294.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
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); |