Commit d5326e78 authored by unknown's avatar unknown

move thr_client_alarm initialization to mysqld.cc

(in thr_alarm.cc it happened too late).


mysys/thr_alarm.c:
  move thr_client_alarm initialization to mysqld.cc
  (here it happened too late)
sql/mysqld.cc:
  move thr_client_alarm initialization to mysqld.cc
  (in thr_alarm.cc it happened too late).
  moved thr_kill_signal initialization to init_signals()
parent 3b96b4d2
...@@ -78,10 +78,6 @@ void init_thr_alarm(uint max_alarms) ...@@ -78,10 +78,6 @@ void init_thr_alarm(uint max_alarms)
sigfillset(&full_signal_set); /* Neaded to block signals */ sigfillset(&full_signal_set); /* Neaded to block signals */
pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST); pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST);
pthread_cond_init(&COND_alarm,NULL); pthread_cond_init(&COND_alarm,NULL);
if (thd_lib_detected == THD_LIB_LT)
thr_client_alarm= SIGALRM;
else
thr_client_alarm= SIGUSR1;
#ifndef USE_ALARM_THREAD #ifndef USE_ALARM_THREAD
if (thd_lib_detected != THD_LIB_LT) if (thd_lib_detected != THD_LIB_LT)
#endif #endif
......
...@@ -2046,6 +2046,17 @@ static void init_signals(void) ...@@ -2046,6 +2046,17 @@ static void init_signals(void)
struct sigaction sa; struct sigaction sa;
DBUG_ENTER("init_signals"); DBUG_ENTER("init_signals");
if (thd_lib_detected == THD_LIB_LT)
{
thr_client_alarm= SIGALRM;
thr_kill_signal= SIGINT;
}
else
{
thr_client_alarm= SIGUSR1;
thr_kill_signal= SIGUSR2;
}
if (test_flags & TEST_SIGINT) if (test_flags & TEST_SIGINT)
{ {
my_sigset(thr_kill_signal, end_thread_signal); my_sigset(thr_kill_signal, end_thread_signal);
...@@ -3140,9 +3151,6 @@ int main(int argc, char **argv) ...@@ -3140,9 +3151,6 @@ int main(int argc, char **argv)
MY_INIT(argv[0]); // init my_sys library & pthreads MY_INIT(argv[0]); // init my_sys library & pthreads
/* Set signal used to kill MySQL */
thr_kill_signal= thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2;
#ifdef _CUSTOMSTARTUPCONFIG_ #ifdef _CUSTOMSTARTUPCONFIG_
if (_cust_check_startup()) if (_cust_check_startup())
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment