diff options
author | unknown <jani@a88-113-38-195.elisa-laajakaista.fi> | 2007-01-22 03:33:59 +0200 |
---|---|---|
committer | unknown <jani@a88-113-38-195.elisa-laajakaista.fi> | 2007-01-22 03:33:59 +0200 |
commit | 077840fa23d65e1eb60fdd601802b151ff4b54b4 (patch) | |
tree | 2c5744d9e9cf04714fcd0fe9214cfb40b2656b74 /sql | |
parent | 4fda992bff2034ff551d30cb5da742184ff4a3df (diff) | |
parent | 454c763c6be44b34c8e1ff9b8561ab21e717b742 (diff) | |
download | mariadb-git-077840fa23d65e1eb60fdd601802b151ff4b54b4.tar.gz |
Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-4.0
into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-4.1
include/thr_alarm.h:
Auto merged
mysys/my_pthread.c:
Auto merged
BUILD/SETUP.sh:
Merged from 4.0
configure.in:
Merged from 4.0
include/my_global.h:
Merged from 4.0
include/my_pthread.h:
Merged from 4.0
mysys/thr_alarm.c:
Merged from 4.0
sql/mysqld.cc:
Merged from 4.0
BUILD/SETUP.sh.rej:
Merged from 4.0
configure.in.rej:
Merged from 4.0
include/my_global.h.rej:
Merged from 4.0
include/my_pthread.h.rej:
Merged from 4.0
mysys/thr_alarm.c.rej:
Merged from 4.0
sql/mysqld.cc.rej:
Merged from 4.0
Diffstat (limited to 'sql')
-rw-r--r-- | sql/mysqld.cc | 46 | ||||
-rw-r--r-- | sql/mysqld.cc.rej | 161 |
2 files changed, 192 insertions, 15 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 024e4682a22..d9962eec4c1 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -210,12 +210,6 @@ inline void reset_floating_point_exceptions() } /* cplusplus */ - -#if defined(HAVE_LINUXTHREADS) -#define THR_KILL_SIGNAL SIGINT -#else -#define THR_KILL_SIGNAL SIGUSR2 // Can't use this with LinuxThreads -#endif #define MYSQL_KILL_SIGNAL SIGTERM #ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R @@ -587,6 +581,7 @@ static void clean_up_mutexes(void); static void wait_for_signal_thread_to_end(void); static int test_if_case_insensitive(const char *dir_name); static void create_pid_file(); +static uint get_thread_lib(void); #ifndef EMBEDDED_LIBRARY /**************************************************************************** @@ -626,7 +621,8 @@ static void close_connections(void) DBUG_PRINT("info",("Waiting for select thread")); #ifndef DONT_USE_THR_ALARM - if (pthread_kill(select_thread,THR_CLIENT_ALARM)) + if (pthread_kill(select_thread, + thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1)) break; // allready dead #endif set_timespec(abstime, 2); @@ -2049,7 +2045,10 @@ static void init_signals(void) DBUG_ENTER("init_signals"); if (test_flags & TEST_SIGINT) - my_sigset(THR_KILL_SIGNAL,end_thread_signal); + { + my_sigset(thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2, + end_thread_signal); + } my_sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called! if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL)) @@ -2106,8 +2105,12 @@ static void init_signals(void) #endif sigaddset(&set,THR_SERVER_ALARM); if (test_flags & TEST_SIGINT) - sigdelset(&set,THR_KILL_SIGNAL); // May be SIGINT - sigdelset(&set,THR_CLIENT_ALARM); // For alarms + { + // May be SIGINT + sigdelset(&set, thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2); + } + // For alarms + sigdelset(&set, thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1); sigprocmask(SIG_SETMASK,&set,NULL); pthread_sigmask(SIG_SETMASK,&set,NULL); DBUG_VOID_RETURN; @@ -2163,24 +2166,20 @@ extern "C" void *signal_hand(void *arg __attribute__((unused))) */ init_thr_alarm(max_connections + global_system_variables.max_insert_delayed_threads + 10); -#if SIGINT != THR_KILL_SIGNAL - if (test_flags & TEST_SIGINT) + if (thd_lib_detected != THD_LIB_LT && test_flags & TEST_SIGINT) { (void) sigemptyset(&set); // Setup up SIGINT for debug (void) sigaddset(&set,SIGINT); // For debugging (void) pthread_sigmask(SIG_UNBLOCK,&set,NULL); } -#endif (void) sigemptyset(&set); // Setup up SIGINT for debug #ifdef USE_ONE_SIGNAL_HAND (void) sigaddset(&set,THR_SERVER_ALARM); // For alarms #endif #ifndef IGNORE_SIGHUP_SIGQUIT (void) sigaddset(&set,SIGQUIT); -#if THR_CLIENT_ALARM != SIGHUP (void) sigaddset(&set,SIGHUP); #endif -#endif (void) sigaddset(&set,SIGTERM); (void) sigaddset(&set,SIGTSTP); @@ -3148,6 +3147,7 @@ int main(int argc, char **argv) } #endif + thd_lib_detected= get_thread_lib(); if (init_common_variables(MYSQL_CONFIG_NAME, argc, argv, load_default_groups)) unireg_abort(1); // Will do exit @@ -7024,6 +7024,22 @@ static void create_pid_file() } +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; + else if (!strncasecmp(buff, "linuxthreads", 12)) + return THD_LIB_LT; +#endif + return THD_LIB_OTHER; +} + + /***************************************************************************** Instantiate templates *****************************************************************************/ diff --git a/sql/mysqld.cc.rej b/sql/mysqld.cc.rej new file mode 100644 index 00000000000..bd7338143ae --- /dev/null +++ b/sql/mysqld.cc.rej @@ -0,0 +1,161 @@ +*************** +*** 177,188 **** + } /* cplusplus */ + + +- #if defined(HAVE_LINUXTHREADS) +- #define THR_KILL_SIGNAL SIGINT +- #else +- #define THR_KILL_SIGNAL SIGUSR2 // Can't use this with LinuxThreads +- #endif +- + #ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R + #include <sys/types.h> + #else +--- 177,182 ---- + } /* cplusplus */ + + + #ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R + #include <sys/types.h> + #else +*************** +*** 505,510 **** + static void clean_up_mutexes(void); + static int test_if_case_insensitive(const char *dir_name); + static void create_pid_file(); + + /**************************************************************************** + ** Code to end mysqld +--- 499,505 ---- + static void clean_up_mutexes(void); + static int test_if_case_insensitive(const char *dir_name); + static void create_pid_file(); ++ static uint get_thread_lib(void); + + /**************************************************************************** + ** Code to end mysqld +*************** +*** 544,550 **** + DBUG_PRINT("info",("Waiting for select_thread")); + + #ifndef DONT_USE_THR_ALARM +! if (pthread_kill(select_thread,THR_CLIENT_ALARM)) + break; // allready dead + #endif + set_timespec(abstime, 2); +--- 539,546 ---- + DBUG_PRINT("info",("Waiting for select_thread")); + + #ifndef DONT_USE_THR_ALARM +! if (pthread_kill(select_thread, +! thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1)) + break; // allready dead + #endif + set_timespec(abstime, 2); +*************** +*** 844,850 **** + sig,my_thread_id()); + } + #ifdef DONT_REMEMBER_SIGNAL +! sigset(sig,print_signal_warning); /* int. thread system calls */ + #endif + #if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) + if (sig == SIGALRM) +--- 840,846 ---- + sig,my_thread_id()); + } + #ifdef DONT_REMEMBER_SIGNAL +! my_sigset(sig, print_signal_warning); /* int. thread system calls */ + #endif + #if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) + if (sig == SIGALRM) +*************** +*** 1841,1848 **** + DBUG_ENTER("init_signals"); + + if (test_flags & TEST_SIGINT) +! sigset(THR_KILL_SIGNAL,end_thread_signal); +! sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called! + + if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL)) + { +--- 1837,1847 ---- + DBUG_ENTER("init_signals"); + + if (test_flags & TEST_SIGINT) +! { +! my_sigset(thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2, +! end_thread_signal); +! } +! my_sigset(THR_SERVER_ALARM, print_signal_warning); // Should never be called! + + if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL)) + { +*************** +*** 1877,1883 **** + #endif + (void) sigemptyset(&set); + #ifdef THREAD_SPECIFIC_SIGPIPE +! sigset(SIGPIPE,abort_thread); + sigaddset(&set,SIGPIPE); + #else + (void) signal(SIGPIPE,SIG_IGN); // Can't know which thread +--- 1876,1882 ---- + #endif + (void) sigemptyset(&set); + #ifdef THREAD_SPECIFIC_SIGPIPE +! my_sigset(SIGPIPE, abort_thread); + sigaddset(&set,SIGPIPE); + #else + (void) signal(SIGPIPE,SIG_IGN); // Can't know which thread +*************** +*** 2237,2244 **** + MY_INIT(argv[0]); // init my_sys library & pthreads + tzset(); // Set tzname + + start_time=time((time_t*) 0); +- + #ifdef OS2 + { + // fix timezone for daylight saving +--- 2236,2243 ---- + MY_INIT(argv[0]); // init my_sys library & pthreads + tzset(); // Set tzname + ++ thd_lib_detected= get_thread_lib(); + start_time=time((time_t*) 0); + #ifdef OS2 + { + // fix timezone for daylight saving +*************** +*** 5547,5552 **** + (void) my_write(file, (byte*) buff, (uint) (end-buff),MYF(MY_WME)); + (void) my_close(file, MYF(0)); + } + } + + +--- 5546,5567 ---- + (void) my_write(file, (byte*) buff, (uint) (end-buff),MYF(MY_WME)); + (void) my_close(file, MYF(0)); + } ++ } ++ ++ ++ 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; ++ else if (!strncasecmp(buff, "linuxthreads", 12)) ++ return THD_LIB_LT; ++ #endif ++ return THD_LIB_OTHER; + } + + |