summaryrefslogtreecommitdiff
path: root/mysys/my_thr_init.c
diff options
context:
space:
mode:
authorunknown <istruewing@chilla.local>2007-02-01 10:19:22 +0100
committerunknown <istruewing@chilla.local>2007-02-01 10:19:22 +0100
commit8772cb168b43528a2fcef03ece3078f58cb34d40 (patch)
tree022725674254e6cf9a1dda24210e53fd3dc844fd /mysys/my_thr_init.c
parentad7a4ebbe31d3bd6113e5f26107db6fffaddea1c (diff)
parent62fdcb54a7e03282b19b8661e0f78e766e3b2a36 (diff)
downloadmariadb-git-8772cb168b43528a2fcef03ece3078f58cb34d40.tar.gz
Merge chilla.local:/home/mydev/mysql-4.1-axmrg
into chilla.local:/home/mydev/mysql-5.0-axmrg include/my_global.h: Auto merged include/thr_alarm.h: Auto merged mysys/my_pthread.c: Auto merged mysys/thr_alarm.c: Auto merged include/my_pthread.h: Manual merged mysys/default.c: Manual merged mysys/my_thr_init.c: Manual merged sql/mysqld.cc: Manual merged
Diffstat (limited to 'mysys/my_thr_init.c')
-rw-r--r--mysys/my_thr_init.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index c5105dc4e1e..b364498fb48 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -20,6 +20,7 @@
#include "mysys_priv.h"
#include <m_string.h>
+#include <signal.h>
#ifdef THREAD
#ifdef USE_TLS
@@ -63,6 +64,8 @@ pthread_handler_t nptl_pthread_exit_hack_handler(void *arg)
#endif
+static uint get_thread_lib(void);
+
/*
initialize thread environment
@@ -76,6 +79,12 @@ pthread_handler_t nptl_pthread_exit_hack_handler(void *arg)
my_bool my_thread_global_init(void)
{
+ thd_lib_detected= get_thread_lib();
+ if (thd_lib_detected == THD_LIB_LT)
+ thr_client_alarm= SIGALRM;
+ else
+ thr_client_alarm= SIGUSR1;
+
if (pthread_key_create(&THR_KEY_mysys,0))
{
fprintf(stderr,"Can't initialize threads: error %d\n",errno);
@@ -392,4 +401,20 @@ const char *my_thread_name(void)
}
#endif /* DBUG_OFF */
+
+static uint get_thread_lib(void)
+{
+ char buff[64];
+
+#ifdef _CS_GNU_LIBPTHREAD_VERSION
+ confstr(_CS_GNU_LIBPTHREAD_VERSION, buff, sizeof(buff));
+
+ if (!strncasecmp(buff, "NPTL", 4))
+ return THD_LIB_NPTL;
+ if (!strncasecmp(buff, "linuxthreads", 12))
+ return THD_LIB_LT;
+#endif
+ return THD_LIB_OTHER;
+}
+
#endif /* THREAD */