summaryrefslogtreecommitdiff
path: root/mysys/my_pthread.c
diff options
context:
space:
mode:
authorunknown <jani@a88-113-38-195.elisa-laajakaista.fi>2007-01-22 02:32:07 +0200
committerunknown <jani@a88-113-38-195.elisa-laajakaista.fi>2007-01-22 02:32:07 +0200
commit454c763c6be44b34c8e1ff9b8561ab21e717b742 (patch)
tree48ef8f384e9e6131e128376bb19245a4cfec17c3 /mysys/my_pthread.c
parent7b2b2231a2df30198eb5dd4a35f7270dec5e5468 (diff)
downloadmariadb-git-454c763c6be44b34c8e1ff9b8561ab21e717b742.tar.gz
Fix for configure to detect library correctly.
Fix to check library in use during runtime. Fix for Bug#16995, "idle connections not being killed due to timeout when NPTL is used". BUILD/SETUP.sh: To avoid warnings during compilation. configure.in: Fixed configure so that it can correctly detect between NPTL and Linuxthreads. include/my_global.h: Fix for Linuxthreads. include/my_pthread.h: Added defines for different libraries that can be detected. Currently only 'other', 'nptl', and 'lt' (linuxthreads) are being used. changed sigset() and signal() to my_sigset() and my_signal() include/thr_alarm.h: Removed defines for Linuxthreads. This is now detected during runtime and handled in the thr_alarm.c mysys/my_pthread.c: Runtime check for library. mysys/thr_alarm.c: Runtime checks for library and corresponding signals. sql/mysqld.cc: Added function for detecting thread library in use during start-up. THR_KILL_SIGNAL removed, setting signals during runtime.
Diffstat (limited to 'mysys/my_pthread.c')
-rw-r--r--mysys/my_pthread.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index a8157cc2f91..3eaf27844b2 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -31,6 +31,8 @@
#define SCHED_POLICY SCHED_OTHER
#endif
+uint thd_lib_detected;
+
#ifndef my_pthread_setprio
void my_pthread_setprio(pthread_t thread_id,int prior)
{
@@ -320,7 +322,7 @@ void *sigwait_thread(void *set_arg)
sigaction(i, &sact, (struct sigaction*) 0);
}
}
- sigaddset(set,THR_CLIENT_ALARM);
+ sigaddset(set, thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1);
pthread_sigmask(SIG_UNBLOCK,(sigset_t*) set,(sigset_t*) 0);
alarm_thread=pthread_self(); /* For thr_alarm */