Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
db8a7b51
Commit
db8a7b51
authored
Feb 07, 2007
by
svoj@mysql.com/april.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Excluded wrongly merged changeset.
parent
4a6770e0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
82 deletions
+45
-82
include/my_pthread.h
include/my_pthread.h
+0
-9
include/thr_alarm.h
include/thr_alarm.h
+5
-3
mysys/my_pthread.c
mysys/my_pthread.c
+3
-5
mysys/my_thr_init.c
mysys/my_thr_init.c
+0
-21
mysys/thr_alarm.c
mysys/thr_alarm.c
+22
-25
sql/mysqld.cc
sql/mysqld.cc
+15
-19
No files found.
include/my_pthread.h
View file @
db8a7b51
...
@@ -690,15 +690,6 @@ extern uint my_thread_end_wait_time;
...
@@ -690,15 +690,6 @@ extern uint my_thread_end_wait_time;
Keep track of shutdown,signal, and main threads so that my_end() will not
Keep track of shutdown,signal, and main threads so that my_end() will not
report errors with them
report errors with them
*/
*/
/* 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 */
/* statistics_xxx functions are for not essential statistic */
#ifndef thread_safe_increment
#ifndef thread_safe_increment
...
...
include/thr_alarm.h
View file @
db8a7b51
...
@@ -24,6 +24,11 @@ extern "C" {
...
@@ -24,6 +24,11 @@ extern "C" {
#ifndef USE_ALARM_THREAD
#ifndef USE_ALARM_THREAD
#define USE_ONE_SIGNAL_HAND
/* One must call process_alarm */
#define USE_ONE_SIGNAL_HAND
/* One must call process_alarm */
#endif
#endif
#ifdef HAVE_LINUXTHREADS
#define THR_CLIENT_ALARM SIGALRM
#else
#define THR_CLIENT_ALARM SIGUSR1
#endif
#ifdef HAVE_rts_threads
#ifdef HAVE_rts_threads
#undef USE_ONE_SIGNAL_HAND
#undef USE_ONE_SIGNAL_HAND
#define USE_ALARM_THREAD
#define USE_ALARM_THREAD
...
@@ -84,9 +89,6 @@ typedef struct st_alarm {
...
@@ -84,9 +89,6 @@ typedef struct st_alarm {
my_bool
malloced
;
my_bool
malloced
;
}
ALARM
;
}
ALARM
;
extern
uint
thr_client_alarm
;
extern
pthread_t
alarm_thread
;
#define thr_alarm_init(A) (*(A))=0
#define thr_alarm_init(A) (*(A))=0
#define thr_alarm_in_use(A) (*(A)!= 0)
#define thr_alarm_in_use(A) (*(A)!= 0)
void
init_thr_alarm
(
uint
max_alarm
);
void
init_thr_alarm
(
uint
max_alarm
);
...
...
mysys/my_pthread.c
View file @
db8a7b51
...
@@ -29,8 +29,6 @@
...
@@ -29,8 +29,6 @@
#define SCHED_POLICY SCHED_OTHER
#define SCHED_POLICY SCHED_OTHER
#endif
#endif
uint
thd_lib_detected
;
#ifndef my_pthread_setprio
#ifndef my_pthread_setprio
void
my_pthread_setprio
(
pthread_t
thread_id
,
int
prior
)
void
my_pthread_setprio
(
pthread_t
thread_id
,
int
prior
)
{
{
...
@@ -314,6 +312,8 @@ void sigwait_handle_sig(int sig)
...
@@ -314,6 +312,8 @@ void sigwait_handle_sig(int sig)
pthread_mutex_unlock
(
&
LOCK_sigwait
);
pthread_mutex_unlock
(
&
LOCK_sigwait
);
}
}
extern
pthread_t
alarm_thread
;
void
*
sigwait_thread
(
void
*
set_arg
)
void
*
sigwait_thread
(
void
*
set_arg
)
{
{
sigset_t
*
set
=
(
sigset_t
*
)
set_arg
;
sigset_t
*
set
=
(
sigset_t
*
)
set_arg
;
...
@@ -332,9 +332,7 @@ void *sigwait_thread(void *set_arg)
...
@@ -332,9 +332,7 @@ void *sigwait_thread(void *set_arg)
sigaction
(
i
,
&
sact
,
(
struct
sigaction
*
)
0
);
sigaction
(
i
,
&
sact
,
(
struct
sigaction
*
)
0
);
}
}
}
}
/* Ensure that init_thr_alarm() is called */
sigaddset
(
set
,
THR_CLIENT_ALARM
);
DBUG_ASSERT
(
thr_client_alarm
);
sigaddset
(
set
,
thr_client_alarm
);
pthread_sigmask
(
SIG_UNBLOCK
,(
sigset_t
*
)
set
,(
sigset_t
*
)
0
);
pthread_sigmask
(
SIG_UNBLOCK
,(
sigset_t
*
)
set
,(
sigset_t
*
)
0
);
alarm_thread
=
pthread_self
();
/* For thr_alarm */
alarm_thread
=
pthread_self
();
/* For thr_alarm */
...
...
mysys/my_thr_init.c
View file @
db8a7b51
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
#include "mysys_priv.h"
#include "mysys_priv.h"
#include <m_string.h>
#include <m_string.h>
#include <signal.h>
#ifdef THREAD
#ifdef THREAD
#ifdef USE_TLS
#ifdef USE_TLS
...
@@ -64,8 +63,6 @@ pthread_handler_t nptl_pthread_exit_hack_handler(void *arg)
...
@@ -64,8 +63,6 @@ pthread_handler_t nptl_pthread_exit_hack_handler(void *arg)
#endif
#endif
static
uint
get_thread_lib
(
void
);
/*
/*
initialize thread environment
initialize thread environment
...
@@ -79,8 +76,6 @@ static uint get_thread_lib(void);
...
@@ -79,8 +76,6 @@ static uint get_thread_lib(void);
my_bool
my_thread_global_init
(
void
)
my_bool
my_thread_global_init
(
void
)
{
{
thd_lib_detected
=
get_thread_lib
();
if
(
pthread_key_create
(
&
THR_KEY_mysys
,
0
))
if
(
pthread_key_create
(
&
THR_KEY_mysys
,
0
))
{
{
fprintf
(
stderr
,
"Can't initialize threads: error %d
\n
"
,
errno
);
fprintf
(
stderr
,
"Can't initialize threads: error %d
\n
"
,
errno
);
...
@@ -397,20 +392,4 @@ const char *my_thread_name(void)
...
@@ -397,20 +392,4 @@ const char *my_thread_name(void)
}
}
#endif
/* DBUG_OFF */
#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 */
#endif
/* THREAD */
mysys/thr_alarm.c
View file @
db8a7b51
...
@@ -34,7 +34,6 @@
...
@@ -34,7 +34,6 @@
#define ETIME ETIMEDOUT
#define ETIME ETIMEDOUT
#endif
#endif
uint
thr_client_alarm
;
static
int
alarm_aborted
=
1
;
/* No alarm thread */
static
int
alarm_aborted
=
1
;
/* No alarm thread */
my_bool
thr_alarm_inited
=
0
;
my_bool
thr_alarm_inited
=
0
;
volatile
my_bool
alarm_thread_running
=
0
;
volatile
my_bool
alarm_thread_running
=
0
;
...
@@ -57,7 +56,9 @@ static void *alarm_handler(void *arg);
...
@@ -57,7 +56,9 @@ static void *alarm_handler(void *arg);
#define reschedule_alarms() pthread_kill(alarm_thread,THR_SERVER_ALARM)
#define reschedule_alarms() pthread_kill(alarm_thread,THR_SERVER_ALARM)
#endif
#endif
#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD)
static
sig_handler
thread_alarm
(
int
sig
__attribute__
((
unused
)));
static
sig_handler
thread_alarm
(
int
sig
__attribute__
((
unused
)));
#endif
static
int
compare_ulong
(
void
*
not_used
__attribute__
((
unused
)),
static
int
compare_ulong
(
void
*
not_used
__attribute__
((
unused
)),
byte
*
a_ptr
,
byte
*
b_ptr
)
byte
*
a_ptr
,
byte
*
b_ptr
)
...
@@ -76,16 +77,9 @@ void init_thr_alarm(uint max_alarms)
...
@@ -76,16 +77,9 @@ 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
)
#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD)
thr_client_alarm
=
SIGALRM
;
my_sigset
(
THR_CLIENT_ALARM
,
thread_alarm
);
else
thr_client_alarm
=
SIGUSR1
;
#ifndef USE_ALARM_THREAD
if
(
thd_lib_detected
!=
THD_LIB_LT
)
#endif
#endif
{
my_sigset
(
thr_client_alarm
,
thread_alarm
);
}
sigemptyset
(
&
s
);
sigemptyset
(
&
s
);
sigaddset
(
&
s
,
THR_SERVER_ALARM
);
sigaddset
(
&
s
,
THR_SERVER_ALARM
);
alarm_thread
=
pthread_self
();
alarm_thread
=
pthread_self
();
...
@@ -103,11 +97,10 @@ void init_thr_alarm(uint max_alarms)
...
@@ -103,11 +97,10 @@ void init_thr_alarm(uint max_alarms)
}
}
#elif defined(USE_ONE_SIGNAL_HAND)
#elif defined(USE_ONE_SIGNAL_HAND)
pthread_sigmask
(
SIG_BLOCK
,
&
s
,
NULL
);
/* used with sigwait() */
pthread_sigmask
(
SIG_BLOCK
,
&
s
,
NULL
);
/* used with sigwait() */
if
(
thd_lib_detected
==
THD_LIB_LT
)
#if THR_SERVER_ALARM == THR_CLIENT_ALARM
{
my_sigset
(
THR_CLIENT_ALARM
,
process_alarm
);
/* Linuxthreads */
my_sigset
(
thr_client_alarm
,
process_alarm
);
/* Linuxthreads */
pthread_sigmask
(
SIG_UNBLOCK
,
&
s
,
NULL
);
pthread_sigmask
(
SIG_UNBLOCK
,
&
s
,
NULL
);
#endif
}
#else
#else
my_sigset
(
THR_SERVER_ALARM
,
process_alarm
);
my_sigset
(
THR_SERVER_ALARM
,
process_alarm
);
pthread_sigmask
(
SIG_UNBLOCK
,
&
s
,
NULL
);
pthread_sigmask
(
SIG_UNBLOCK
,
&
s
,
NULL
);
...
@@ -158,7 +151,7 @@ my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
...
@@ -158,7 +151,7 @@ my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
now
=
(
ulong
)
time
((
time_t
*
)
0
);
now
=
(
ulong
)
time
((
time_t
*
)
0
);
pthread_sigmask
(
SIG_BLOCK
,
&
full_signal_set
,
&
old_mask
);
pthread_sigmask
(
SIG_BLOCK
,
&
full_signal_set
,
&
old_mask
);
pthread_mutex_lock
(
&
LOCK_alarm
);
/* Lock from threads & alarms */
pthread_mutex_lock
(
&
LOCK_alarm
);
/* Lock from threads & alarms */
if
(
alarm_aborted
>
0
)
if
(
alarm_aborted
>
0
)
{
/* No signal thread */
{
/* No signal thread */
DBUG_PRINT
(
"info"
,
(
"alarm aborted"
));
DBUG_PRINT
(
"info"
,
(
"alarm aborted"
));
...
@@ -278,17 +271,18 @@ sig_handler process_alarm(int sig __attribute__((unused)))
...
@@ -278,17 +271,18 @@ sig_handler process_alarm(int sig __attribute__((unused)))
This must be first as we can't call DBUG inside an alarm for a normal thread
This must be first as we can't call DBUG inside an alarm for a normal thread
*/
*/
if
(
thd_lib_detected
==
THD_LIB_LT
&&
#if THR_SERVER_ALARM == THR_CLIENT_ALARM
!
pthread_equal
(
pthread_self
(),
alarm_thread
))
if
(
!
pthread_equal
(
pthread_self
(),
alarm_thread
))
{
{
#if defined(MAIN) && !defined(__bsdi__)
#if defined(MAIN) && !defined(__bsdi__)
printf
(
"thread_alarm in process_alarm
\n
"
);
fflush
(
stdout
);
printf
(
"thread_alarm in process_alarm
\n
"
);
fflush
(
stdout
);
#endif
#endif
#ifdef DONT_REMEMBER_SIGNAL
#ifdef DONT_REMEMBER_SIGNAL
my_sigset
(
thr_client_alarm
,
process_alarm
);
/* int. thread system calls */
my_sigset
(
THR_CLIENT_ALARM
,
process_alarm
);
/* int. thread system calls */
#endif
#endif
return
;
return
;
}
}
#endif
/*
/*
We have to do do the handling of the alarm in a sub function,
We have to do do the handling of the alarm in a sub function,
...
@@ -332,7 +326,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused)))
...
@@ -332,7 +326,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused)))
alarm_data
=
(
ALARM
*
)
queue_element
(
&
alarm_queue
,
i
);
alarm_data
=
(
ALARM
*
)
queue_element
(
&
alarm_queue
,
i
);
alarm_data
->
alarmed
=
1
;
/* Info to thread */
alarm_data
->
alarmed
=
1
;
/* Info to thread */
if
(
pthread_equal
(
alarm_data
->
thread
,
alarm_thread
)
||
if
(
pthread_equal
(
alarm_data
->
thread
,
alarm_thread
)
||
pthread_kill
(
alarm_data
->
thread
,
thr_client_alarm
))
pthread_kill
(
alarm_data
->
thread
,
THR_CLIENT_ALARM
))
{
{
#ifdef MAIN
#ifdef MAIN
printf
(
"Warning: pthread_kill couldn't find thread!!!
\n
"
);
printf
(
"Warning: pthread_kill couldn't find thread!!!
\n
"
);
...
@@ -356,7 +350,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused)))
...
@@ -356,7 +350,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused)))
alarm_data
->
alarmed
=
1
;
/* Info to thread */
alarm_data
->
alarmed
=
1
;
/* Info to thread */
DBUG_PRINT
(
"info"
,(
"sending signal to waiting thread"
));
DBUG_PRINT
(
"info"
,(
"sending signal to waiting thread"
));
if
(
pthread_equal
(
alarm_data
->
thread
,
alarm_thread
)
||
if
(
pthread_equal
(
alarm_data
->
thread
,
alarm_thread
)
||
pthread_kill
(
alarm_data
->
thread
,
thr_client_alarm
))
pthread_kill
(
alarm_data
->
thread
,
THR_CLIENT_ALARM
))
{
{
#ifdef MAIN
#ifdef MAIN
printf
(
"Warning: pthread_kill couldn't find thread!!!
\n
"
);
printf
(
"Warning: pthread_kill couldn't find thread!!!
\n
"
);
...
@@ -493,7 +487,7 @@ void thr_alarm_info(ALARM_INFO *info)
...
@@ -493,7 +487,7 @@ void thr_alarm_info(ALARM_INFO *info)
ARGSUSED
ARGSUSED
*/
*/
#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD)
static
sig_handler
thread_alarm
(
int
sig
)
static
sig_handler
thread_alarm
(
int
sig
)
{
{
#ifdef MAIN
#ifdef MAIN
...
@@ -503,6 +497,7 @@ static sig_handler thread_alarm(int sig)
...
@@ -503,6 +497,7 @@ static sig_handler thread_alarm(int sig)
my_sigset
(
sig
,
thread_alarm
);
/* int. thread system calls */
my_sigset
(
sig
,
thread_alarm
);
/* int. thread system calls */
#endif
#endif
}
}
#endif
#ifdef HAVE_TIMESPEC_TS_SEC
#ifdef HAVE_TIMESPEC_TS_SEC
...
@@ -788,7 +783,9 @@ static void *signal_hand(void *arg __attribute__((unused)))
...
@@ -788,7 +783,9 @@ static void *signal_hand(void *arg __attribute__((unused)))
sigaddset
(
&
set
,
SIGINT
);
sigaddset
(
&
set
,
SIGINT
);
sigaddset
(
&
set
,
SIGQUIT
);
sigaddset
(
&
set
,
SIGQUIT
);
sigaddset
(
&
set
,
SIGTERM
);
sigaddset
(
&
set
,
SIGTERM
);
#if THR_CLIENT_ALARM != SIGHUP
sigaddset
(
&
set
,
SIGHUP
);
sigaddset
(
&
set
,
SIGHUP
);
#endif
#ifdef SIGTSTP
#ifdef SIGTSTP
sigaddset
(
&
set
,
SIGTSTP
);
sigaddset
(
&
set
,
SIGTSTP
);
#endif
#endif
...
@@ -799,7 +796,7 @@ static void *signal_hand(void *arg __attribute__((unused)))
...
@@ -799,7 +796,7 @@ static void *signal_hand(void *arg __attribute__((unused)))
puts
(
"Starting signal handling thread"
);
puts
(
"Starting signal handling thread"
);
#endif
#endif
printf
(
"server alarm: %d thread alarm: %d
\n
"
,
printf
(
"server alarm: %d thread alarm: %d
\n
"
,
THR_SERVER_ALARM
,
thr_client_alarm
);
THR_SERVER_ALARM
,
THR_CLIENT_ALARM
);
DBUG_PRINT
(
"info"
,(
"Starting signal and alarm handling thread"
));
DBUG_PRINT
(
"info"
,(
"Starting signal and alarm handling thread"
));
for
(;;)
for
(;;)
{
{
...
@@ -867,11 +864,11 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
...
@@ -867,11 +864,11 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
sigaddset
(
&
set
,
SIGTSTP
);
sigaddset
(
&
set
,
SIGTSTP
);
#endif
#endif
sigaddset
(
&
set
,
THR_SERVER_ALARM
);
sigaddset
(
&
set
,
THR_SERVER_ALARM
);
sigdelset
(
&
set
,
thr_client_alarm
);
sigdelset
(
&
set
,
THR_CLIENT_ALARM
);
(
void
)
pthread_sigmask
(
SIG_SETMASK
,
&
set
,
NULL
);
(
void
)
pthread_sigmask
(
SIG_SETMASK
,
&
set
,
NULL
);
#ifdef NOT_USED
#ifdef NOT_USED
sigemptyset
(
&
set
);
sigemptyset
(
&
set
);
sigaddset
(
&
set
,
thr_client_alarm
);
sigaddset
(
&
set
,
THR_CLIENT_ALARM
);
VOID
(
pthread_sigmask
(
SIG_UNBLOCK
,
&
set
,
(
sigset_t
*
)
0
));
VOID
(
pthread_sigmask
(
SIG_UNBLOCK
,
&
set
,
(
sigset_t
*
)
0
));
#endif
#endif
...
...
sql/mysqld.cc
View file @
db8a7b51
...
@@ -199,6 +199,12 @@ inline void reset_floating_point_exceptions()
...
@@ -199,6 +199,12 @@ inline void reset_floating_point_exceptions()
}
/* cplusplus */
}
/* 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
#define MYSQL_KILL_SIGNAL SIGTERM
#ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
#ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
...
@@ -587,7 +593,6 @@ pthread_mutex_t LOCK_server_started;
...
@@ -587,7 +593,6 @@ pthread_mutex_t LOCK_server_started;
pthread_cond_t
COND_server_started
;
pthread_cond_t
COND_server_started
;
int
mysqld_server_started
=
0
;
int
mysqld_server_started
=
0
;
static
uint
thr_kill_signal
;
File_parser_dummy_hook
file_parser_dummy_hook
;
File_parser_dummy_hook
file_parser_dummy_hook
;
...
@@ -769,7 +774,7 @@ static void close_connections(void)
...
@@ -769,7 +774,7 @@ static void close_connections(void)
DBUG_PRINT
(
"info"
,(
"Waiting for select thread"
));
DBUG_PRINT
(
"info"
,(
"Waiting for select thread"
));
#ifndef DONT_USE_THR_ALARM
#ifndef DONT_USE_THR_ALARM
if
(
pthread_kill
(
select_thread
,
thr_client_alarm
))
if
(
pthread_kill
(
select_thread
,
THR_CLIENT_ALARM
))
break
;
// allready dead
break
;
// allready dead
#endif
#endif
set_timespec
(
abstime
,
2
);
set_timespec
(
abstime
,
2
);
...
@@ -2206,9 +2211,7 @@ static void init_signals(void)
...
@@ -2206,9 +2211,7 @@ static void init_signals(void)
DBUG_ENTER
(
"init_signals"
);
DBUG_ENTER
(
"init_signals"
);
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
);
}
my_sigset
(
THR_SERVER_ALARM
,
print_signal_warning
);
// Should never be called!
my_sigset
(
THR_SERVER_ALARM
,
print_signal_warning
);
// Should never be called!
if
(
!
(
test_flags
&
TEST_NO_STACKTRACE
)
||
(
test_flags
&
TEST_CORE_ON_SIGNAL
))
if
(
!
(
test_flags
&
TEST_NO_STACKTRACE
)
||
(
test_flags
&
TEST_CORE_ON_SIGNAL
))
...
@@ -2265,12 +2268,8 @@ static void init_signals(void)
...
@@ -2265,12 +2268,8 @@ static void init_signals(void)
#endif
#endif
sigaddset
(
&
set
,
THR_SERVER_ALARM
);
sigaddset
(
&
set
,
THR_SERVER_ALARM
);
if
(
test_flags
&
TEST_SIGINT
)
if
(
test_flags
&
TEST_SIGINT
)
{
sigdelset
(
&
set
,
THR_KILL_SIGNAL
);
// May be SIGINT
// May be SIGINT
sigdelset
(
&
set
,
THR_CLIENT_ALARM
);
// For alarms
sigdelset
(
&
set
,
thr_kill_signal
);
}
// For alarms
sigdelset
(
&
set
,
thr_client_alarm
);
sigprocmask
(
SIG_SETMASK
,
&
set
,
NULL
);
sigprocmask
(
SIG_SETMASK
,
&
set
,
NULL
);
pthread_sigmask
(
SIG_SETMASK
,
&
set
,
NULL
);
pthread_sigmask
(
SIG_SETMASK
,
&
set
,
NULL
);
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
...
@@ -2333,19 +2332,23 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
...
@@ -2333,19 +2332,23 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
*/
*/
init_thr_alarm
(
max_connections
+
init_thr_alarm
(
max_connections
+
global_system_variables
.
max_insert_delayed_threads
+
10
);
global_system_variables
.
max_insert_delayed_threads
+
10
);
if
(
thd_lib_detected
!=
THD_LIB_LT
&&
(
test_flags
&
TEST_SIGINT
))
#if SIGINT != THR_KILL_SIGNAL
if
(
test_flags
&
TEST_SIGINT
)
{
{
(
void
)
sigemptyset
(
&
set
);
// Setup up SIGINT for debug
(
void
)
sigemptyset
(
&
set
);
// Setup up SIGINT for debug
(
void
)
sigaddset
(
&
set
,
SIGINT
);
// For debugging
(
void
)
sigaddset
(
&
set
,
SIGINT
);
// For debugging
(
void
)
pthread_sigmask
(
SIG_UNBLOCK
,
&
set
,
NULL
);
(
void
)
pthread_sigmask
(
SIG_UNBLOCK
,
&
set
,
NULL
);
}
}
#endif
(
void
)
sigemptyset
(
&
set
);
// Setup up SIGINT for debug
(
void
)
sigemptyset
(
&
set
);
// Setup up SIGINT for debug
#ifdef USE_ONE_SIGNAL_HAND
#ifdef USE_ONE_SIGNAL_HAND
(
void
)
sigaddset
(
&
set
,
THR_SERVER_ALARM
);
// For alarms
(
void
)
sigaddset
(
&
set
,
THR_SERVER_ALARM
);
// For alarms
#endif
#endif
#ifndef IGNORE_SIGHUP_SIGQUIT
#ifndef IGNORE_SIGHUP_SIGQUIT
(
void
)
sigaddset
(
&
set
,
SIGQUIT
);
(
void
)
sigaddset
(
&
set
,
SIGQUIT
);
#if THR_CLIENT_ALARM != SIGHUP
(
void
)
sigaddset
(
&
set
,
SIGHUP
);
(
void
)
sigaddset
(
&
set
,
SIGHUP
);
#endif
#endif
#endif
(
void
)
sigaddset
(
&
set
,
SIGTERM
);
(
void
)
sigaddset
(
&
set
,
SIGTERM
);
(
void
)
sigaddset
(
&
set
,
SIGTSTP
);
(
void
)
sigaddset
(
&
set
,
SIGTSTP
);
...
@@ -3508,13 +3511,6 @@ int main(int argc, char **argv)
...
@@ -3508,13 +3511,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
/* nothing should come before this line ^^^ */
/* nothing should come before this line ^^^ */
/* Set signal used to kill MySQL */
#if defined(SIGUSR2)
thr_kill_signal
=
thd_lib_detected
==
THD_LIB_LT
?
SIGINT
:
SIGUSR2
;
#else
thr_kill_signal
=
SIGINT
;
#endif
/*
/*
Perform basic logger initialization logger. Should be called after
Perform basic logger initialization logger. Should be called after
MY_INIT, as it initializes mutexes. Log tables are inited later.
MY_INIT, as it initializes mutexes. Log tables are inited later.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment