mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge chilla.local:/home/mydev/mysql-5.0-axmrg
into chilla.local:/home/mydev/mysql-5.1-axmrg client/mysql.cc: Auto merged include/my_global.h: Auto merged include/thr_alarm.h: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/myisam.result: Auto merged mysql-test/r/ps.result: Auto merged mysql-test/r/symlink.result: Auto merged mysql-test/t/myisam.test: Auto merged mysql-test/t/ps.test: Auto merged mysql-test/t/symlink.test: Auto merged mysys/default.c: Auto merged mysys/my_pthread.c: Auto merged mysys/my_thr_init.c: Auto merged mysys/thr_alarm.c: Auto merged sql/field_conv.cc: Auto merged sql/gen_lex_hash.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/item_func.cc: Auto merged vio/viosslfactories.c: Auto merged BitKeeper/deleted/.del-mysqld.cc.rej: Delete: sql/mysqld.cc.rej BitKeeper/deleted/.del-my_create_tables.c~c121a0c4c427ebb: Auto merged BitKeeper/deleted/.del-my_manage.c~4de50e721d227d19: Auto merged BitKeeper/deleted/.del-my_manage.h~9d2cbc1e8bc894f: Auto merged BitKeeper/deleted/.del-mysql.dsw~7ea9e16395f139f4: Null merged BitKeeper/deleted/.del-mysql.sln~76a9ff1e793b3547: Null merged BitKeeper/deleted/.del-mysql_test_run_new.c~a23ab2c4b28b25ad: Auto merged BitKeeper/deleted/.del-mysql_test_run_new.dsp~9d8078f3f02fcc8e: Auto merged BitKeeper/deleted/.del-mysql_test_run_new.vcproj~1ddaed30361efefe: Auto merged BitKeeper/deleted/.del-mysql_test_run_new_ia64.dsp~e7ee71ec8d2995e3: Auto merged BUILD/SETUP.sh: Manual merged Makefile.am: Manual merged configure.in: Manual merged include/my_pthread.h: Manual merged mysql-test/Makefile.am: Manual merged sql/mysqld.cc: Manual merged support-files/mysql.spec.sh: Manual merged
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user