Loading BUILD/SETUP.sh +2 −2 Original line number Diff line number Diff line Loading @@ -39,8 +39,8 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch c_warnings="$global_warnings -Wunused" cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet pentium_cflags="-mcpu=pentiumpro" #alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet #pentium_cflags="-mcpu=pentiumpro" sparc_cflags="" # be as fast as we can be without losing our ability to backtrace Loading configure.in +98 −61 Original line number Diff line number Diff line Loading @@ -388,15 +388,16 @@ AC_MSG_CHECKING("if we should use 'skip-locking' as default for $target_os") if expr "$target_os" : "[[Ll]]inux.*" > /dev/null then MYSQLD_DEFAULT_SWITCHES="--skip-locking" IS_LINUX="true" TARGET_LINUX="true" AC_MSG_RESULT("yes"); AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux]) else MYSQLD_DEFAULT_SWITCHES="" IS_LINUX="false" TARGET_LINUX="false" AC_MSG_RESULT("no"); fi AC_SUBST(MYSQLD_DEFAULT_SWITCHES) AC_SUBST(IS_LINUX) AC_SUBST(TARGET_LINUX) dnl Find paths to some shell programs AC_PATH_PROG(LN, ln, ln) Loading Loading @@ -576,7 +577,7 @@ AC_SUBST(NOINST_LDFLAGS) # (this is true on the MySQL build machines to avoid NSS problems) # if test "$IS_LINUX" = "true" -a "$static_nss" = "" if test "$TARGET_LINUX" = "true" -a "$static_nss" = "" then tmp=`nm /usr/lib/libc.a | grep _nss_files_getaliasent_r` if test -n "$tmp" Loading Loading @@ -827,7 +828,7 @@ struct request_info *req; ]) AC_SUBST(WRAPLIBS) if test "$IS_LINUX" = "true"; then if test "$TARGET_LINUX" = "true"; then AC_MSG_CHECKING([for atomic operations]) AC_LANG_SAVE Loading Loading @@ -870,7 +871,7 @@ int main() [ USE_PSTACK=no ]) pstack_libs= pstack_dirs= if test "$USE_PSTACK" = yes -a "$IS_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386" -a "$with_mit_threads" = "no" if test "$USE_PSTACK" = yes -a "$TARGET_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386" -a "$with_mit_threads" = "no" then have_libiberty= have_libbfd= my_save_LIBS="$LIBS" Loading Loading @@ -1239,14 +1240,39 @@ with_posix_threads="no" # Hack for DEC-UNIX (OSF1) if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" then AC_MSG_CHECKING("Linux threads") if test "$TARGET_LINUX" = "true" then AC_MSG_RESULT("starting") # use getconf to check glibc contents AC_MSG_CHECKING("getconf GNU_LIBPTHREAD_VERSION") case `getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` in NPTL* ) AC_MSG_RESULT("NPTL") AC_DEFINE([HAVE_NPTL], [1], [NPTL threads implementation]) with_named_thread="-lpthread" ;; LINUXTHREADS* ) AC_MSG_RESULT("Linuxthreads") AC_DEFINE([HAVE_LINUXTHREADS], [1], [Whether we are using Xavier Leroy's LinuxThreads]) with_named_thread="-lpthread" ;; * ) AC_MSG_RESULT("unknown") ;; esac if test "$with_named_thread" = "no" then # old method, check headers # Look for LinuxThreads. AC_MSG_CHECKING("LinuxThreads") grepres=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` getconfres=`which getconf >/dev/null && getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |grep LINUXTHREADS | wc -l || echo 0` if test "$grepres" -gt 0 -o "$getconfres" -gt 0 AC_MSG_CHECKING("LinuxThreads in header file comment") res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` if test "$res" -gt 0 then AC_MSG_RESULT("Found") AC_DEFINE(HAVE_LINUXTHREADS) AC_DEFINE([HAVE_LINUXTHREADS], [1], [Whether we are using Xavier Leroy's LinuxThreads]) # Linux 2.0 sanity check AC_TRY_COMPILE([#include <sched.h>], [int a = sched_get_priority_min(1);], , AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual])) Loading @@ -1256,21 +1282,33 @@ then else AC_MSG_RESULT("Not found") # If this is a linux machine we should barf AC_MSG_CHECKING("NPTL") if test "$IS_LINUX" = "true" then getconfres=`which getconf >/dev/null && getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |grep NPTL | wc -l || echo 0` if test "$getconfres" -gt 0 then AC_DEFINE(HAVE_LINUXTHREADS) dnl All this code predates NPTL, so "have linuxthreads" is a poor name. with_named_thread="-lpthread" AC_MSG_ERROR([This is a Linux system without a working getconf, and Linuxthreads was not found. Please install it (or a new glibc) and try again. See the Installation chapter in the Reference Manual for more information.]) fi else AC_MSG_ERROR([This is a Linux system and neither Linuxthreads nor NPTL were found. Please install Linuxthreads or a new glibc and try again. See the Installation chapter in the Reference Manual for more information.]) AC_MSG_RESULT("no need to check headers") fi AC_MSG_CHECKING("for pthread_create in -lpthread"); ac_save_LIBS="$LIBS" LIBS="$LIBS -lpthread" AC_TRY_LINK( [#include <pthread.h>], [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], AC_MSG_RESULT("yes"), [ AC_MSG_RESULT("no") AC_MSG_ERROR([ This is a Linux system claiming to support threads, either Linuxthreads or NPTL, but linking a test program failed. Please install one of these (or a new glibc) and try again. See the Installation chapter in the Reference Manual for more information.]) ] ) LIBS="$ac_save_LIBS" else AC_MSG_RESULT("no") fi # "$TARGET_LINUX" fi # "$with_named_thread" = "no" -a "$with_mit_threads" = "no" if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" then AC_MSG_CHECKING("DEC threads") if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a then Loading @@ -1295,8 +1333,6 @@ more information.]) fi fi fi fi fi dnl This is needed because -lsocket has to come after the thread Loading Loading @@ -1720,7 +1756,7 @@ fi AC_SUBST(COMPILATION_COMMENT) AC_MSG_CHECKING("need of special linking flags") if test "$IS_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes" if test "$TARGET_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes" then LDFLAGS="$LDFLAGS -rdynamic" AC_MSG_RESULT("-rdynamic") Loading Loading @@ -1873,6 +1909,7 @@ AC_CHECK_FUNCS(alarm bmove \ tell atod memcpy memmove \ setupterm strcasecmp sighold vidattr lrand48 localtime_r \ sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \ sigaction sigemptyset sigaddset \ pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \ pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \ pthread_attr_getstacksize pthread_key_delete \ Loading @@ -1884,7 +1921,7 @@ CFLAGS="$ORG_CFLAGS" # Sanity check: We chould not have any fseeko symbol unless # large_file_support=yes AC_CHECK_FUNCS(fseeko, [if test "$large_file_support" = no -a "$IS_LINUX" = "true"; [if test "$large_file_support" = no -a "$TARGET_LINUX" = "true"; then AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!"); fi] Loading include/my_global.h +1 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,7 @@ /* Fix problem with S_ISLNK() on Linux */ #if defined(HAVE_LINUXTHREADS) #if defined(TARGET_OS_LINUX) || defined(__GLIBC__) #undef _GNU_SOURCE #define _GNU_SOURCE 1 #endif Loading include/my_pthread.h +32 −10 Original line number Diff line number Diff line Loading @@ -286,8 +286,8 @@ extern int my_pthread_create_detached; #undef HAVE_PTHREAD_RWLOCK_RDLOCK #undef HAVE_SNPRINTF #define sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) #define signal(A,B) pthread_signal((A),(void (*)(int)) (B)) #define my_sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) #define my_signal(A,B) pthread_signal((A),(void (*)(int)) (B)) #define my_pthread_attr_setprio(A,B) #endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */ Loading Loading @@ -324,14 +324,27 @@ extern int my_pthread_cond_init(pthread_cond_t *mp, #if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ #endif #if !defined(HAVE_SIGSET) && !defined(HAVE_mit_thread) && !defined(sigset) #define sigset(A,B) do { struct sigaction s; sigset_t set; \ /* We define my_sigset() and use that instead of the system sigset() so that we can favor an implementation based on sigaction(). On some systems, such as Mac OS X, sigset() results in flags such as SA_RESTART being set, and we want to make sure that no such flags are set. */ #if defined(HAVE_SIGACTION) && !defined(my_sigset) #define my_sigset(A,B) do { struct sigaction s; sigset_t set; int rc; \ DBUG_ASSERT((A) != 0); \ sigemptyset(&set); \ s.sa_handler = (B); \ s.sa_mask = set; \ s.sa_flags = 0; \ sigaction((A), &s, (struct sigaction *) NULL); \ rc= sigaction((A), &s, (struct sigaction *) NULL); \ DBUG_ASSERT(rc == 0); \ } while (0) #elif defined(HAVE_SIGSET) && !defined(my_sigset) #define my_sigset(A,B) sigset((A),(B)) #elif !defined(my_sigset) #define my_sigset(A,B) signal((A),(B)) #endif #ifndef my_pthread_setprio Loading Loading @@ -416,7 +429,7 @@ struct tm *localtime_r(const time_t *clock, struct tm *res); #undef pthread_detach_this_thread #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } #undef sigset #define sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) #define my_sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) #endif #if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) Loading Loading @@ -663,6 +676,15 @@ extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const)); */ extern pthread_t shutdown_th, main_th, signal_th; /* 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; extern uint thr_client_alarm; /* statistics_xxx functions are for not essential statistic */ #ifndef thread_safe_increment Loading include/thr_alarm.h +2 −5 Original line number Diff line number Diff line Loading @@ -25,11 +25,6 @@ extern "C" { #ifndef USE_ALARM_THREAD #define USE_ONE_SIGNAL_HAND /* One must call process_alarm */ #endif #ifdef HAVE_LINUXTHREADS #define THR_CLIENT_ALARM SIGALRM #else #define THR_CLIENT_ALARM SIGUSR1 #endif #ifdef HAVE_rts_threads #undef USE_ONE_SIGNAL_HAND #define USE_ALARM_THREAD Loading Loading @@ -98,6 +93,8 @@ typedef struct st_alarm { my_bool malloced; } ALARM; extern uint thr_client_alarm; #define thr_alarm_init(A) (*(A))=0 #define thr_alarm_in_use(A) (*(A)!= 0) void init_thr_alarm(uint max_alarm); Loading Loading
BUILD/SETUP.sh +2 −2 Original line number Diff line number Diff line Loading @@ -39,8 +39,8 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch c_warnings="$global_warnings -Wunused" cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet pentium_cflags="-mcpu=pentiumpro" #alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet #pentium_cflags="-mcpu=pentiumpro" sparc_cflags="" # be as fast as we can be without losing our ability to backtrace Loading
configure.in +98 −61 Original line number Diff line number Diff line Loading @@ -388,15 +388,16 @@ AC_MSG_CHECKING("if we should use 'skip-locking' as default for $target_os") if expr "$target_os" : "[[Ll]]inux.*" > /dev/null then MYSQLD_DEFAULT_SWITCHES="--skip-locking" IS_LINUX="true" TARGET_LINUX="true" AC_MSG_RESULT("yes"); AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux]) else MYSQLD_DEFAULT_SWITCHES="" IS_LINUX="false" TARGET_LINUX="false" AC_MSG_RESULT("no"); fi AC_SUBST(MYSQLD_DEFAULT_SWITCHES) AC_SUBST(IS_LINUX) AC_SUBST(TARGET_LINUX) dnl Find paths to some shell programs AC_PATH_PROG(LN, ln, ln) Loading Loading @@ -576,7 +577,7 @@ AC_SUBST(NOINST_LDFLAGS) # (this is true on the MySQL build machines to avoid NSS problems) # if test "$IS_LINUX" = "true" -a "$static_nss" = "" if test "$TARGET_LINUX" = "true" -a "$static_nss" = "" then tmp=`nm /usr/lib/libc.a | grep _nss_files_getaliasent_r` if test -n "$tmp" Loading Loading @@ -827,7 +828,7 @@ struct request_info *req; ]) AC_SUBST(WRAPLIBS) if test "$IS_LINUX" = "true"; then if test "$TARGET_LINUX" = "true"; then AC_MSG_CHECKING([for atomic operations]) AC_LANG_SAVE Loading Loading @@ -870,7 +871,7 @@ int main() [ USE_PSTACK=no ]) pstack_libs= pstack_dirs= if test "$USE_PSTACK" = yes -a "$IS_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386" -a "$with_mit_threads" = "no" if test "$USE_PSTACK" = yes -a "$TARGET_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386" -a "$with_mit_threads" = "no" then have_libiberty= have_libbfd= my_save_LIBS="$LIBS" Loading Loading @@ -1239,14 +1240,39 @@ with_posix_threads="no" # Hack for DEC-UNIX (OSF1) if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" then AC_MSG_CHECKING("Linux threads") if test "$TARGET_LINUX" = "true" then AC_MSG_RESULT("starting") # use getconf to check glibc contents AC_MSG_CHECKING("getconf GNU_LIBPTHREAD_VERSION") case `getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` in NPTL* ) AC_MSG_RESULT("NPTL") AC_DEFINE([HAVE_NPTL], [1], [NPTL threads implementation]) with_named_thread="-lpthread" ;; LINUXTHREADS* ) AC_MSG_RESULT("Linuxthreads") AC_DEFINE([HAVE_LINUXTHREADS], [1], [Whether we are using Xavier Leroy's LinuxThreads]) with_named_thread="-lpthread" ;; * ) AC_MSG_RESULT("unknown") ;; esac if test "$with_named_thread" = "no" then # old method, check headers # Look for LinuxThreads. AC_MSG_CHECKING("LinuxThreads") grepres=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` getconfres=`which getconf >/dev/null && getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |grep LINUXTHREADS | wc -l || echo 0` if test "$grepres" -gt 0 -o "$getconfres" -gt 0 AC_MSG_CHECKING("LinuxThreads in header file comment") res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` if test "$res" -gt 0 then AC_MSG_RESULT("Found") AC_DEFINE(HAVE_LINUXTHREADS) AC_DEFINE([HAVE_LINUXTHREADS], [1], [Whether we are using Xavier Leroy's LinuxThreads]) # Linux 2.0 sanity check AC_TRY_COMPILE([#include <sched.h>], [int a = sched_get_priority_min(1);], , AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual])) Loading @@ -1256,21 +1282,33 @@ then else AC_MSG_RESULT("Not found") # If this is a linux machine we should barf AC_MSG_CHECKING("NPTL") if test "$IS_LINUX" = "true" then getconfres=`which getconf >/dev/null && getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |grep NPTL | wc -l || echo 0` if test "$getconfres" -gt 0 then AC_DEFINE(HAVE_LINUXTHREADS) dnl All this code predates NPTL, so "have linuxthreads" is a poor name. with_named_thread="-lpthread" AC_MSG_ERROR([This is a Linux system without a working getconf, and Linuxthreads was not found. Please install it (or a new glibc) and try again. See the Installation chapter in the Reference Manual for more information.]) fi else AC_MSG_ERROR([This is a Linux system and neither Linuxthreads nor NPTL were found. Please install Linuxthreads or a new glibc and try again. See the Installation chapter in the Reference Manual for more information.]) AC_MSG_RESULT("no need to check headers") fi AC_MSG_CHECKING("for pthread_create in -lpthread"); ac_save_LIBS="$LIBS" LIBS="$LIBS -lpthread" AC_TRY_LINK( [#include <pthread.h>], [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], AC_MSG_RESULT("yes"), [ AC_MSG_RESULT("no") AC_MSG_ERROR([ This is a Linux system claiming to support threads, either Linuxthreads or NPTL, but linking a test program failed. Please install one of these (or a new glibc) and try again. See the Installation chapter in the Reference Manual for more information.]) ] ) LIBS="$ac_save_LIBS" else AC_MSG_RESULT("no") fi # "$TARGET_LINUX" fi # "$with_named_thread" = "no" -a "$with_mit_threads" = "no" if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" then AC_MSG_CHECKING("DEC threads") if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a then Loading @@ -1295,8 +1333,6 @@ more information.]) fi fi fi fi fi dnl This is needed because -lsocket has to come after the thread Loading Loading @@ -1720,7 +1756,7 @@ fi AC_SUBST(COMPILATION_COMMENT) AC_MSG_CHECKING("need of special linking flags") if test "$IS_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes" if test "$TARGET_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes" then LDFLAGS="$LDFLAGS -rdynamic" AC_MSG_RESULT("-rdynamic") Loading Loading @@ -1873,6 +1909,7 @@ AC_CHECK_FUNCS(alarm bmove \ tell atod memcpy memmove \ setupterm strcasecmp sighold vidattr lrand48 localtime_r \ sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \ sigaction sigemptyset sigaddset \ pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \ pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \ pthread_attr_getstacksize pthread_key_delete \ Loading @@ -1884,7 +1921,7 @@ CFLAGS="$ORG_CFLAGS" # Sanity check: We chould not have any fseeko symbol unless # large_file_support=yes AC_CHECK_FUNCS(fseeko, [if test "$large_file_support" = no -a "$IS_LINUX" = "true"; [if test "$large_file_support" = no -a "$TARGET_LINUX" = "true"; then AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!"); fi] Loading
include/my_global.h +1 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,7 @@ /* Fix problem with S_ISLNK() on Linux */ #if defined(HAVE_LINUXTHREADS) #if defined(TARGET_OS_LINUX) || defined(__GLIBC__) #undef _GNU_SOURCE #define _GNU_SOURCE 1 #endif Loading
include/my_pthread.h +32 −10 Original line number Diff line number Diff line Loading @@ -286,8 +286,8 @@ extern int my_pthread_create_detached; #undef HAVE_PTHREAD_RWLOCK_RDLOCK #undef HAVE_SNPRINTF #define sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) #define signal(A,B) pthread_signal((A),(void (*)(int)) (B)) #define my_sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) #define my_signal(A,B) pthread_signal((A),(void (*)(int)) (B)) #define my_pthread_attr_setprio(A,B) #endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */ Loading Loading @@ -324,14 +324,27 @@ extern int my_pthread_cond_init(pthread_cond_t *mp, #if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ #endif #if !defined(HAVE_SIGSET) && !defined(HAVE_mit_thread) && !defined(sigset) #define sigset(A,B) do { struct sigaction s; sigset_t set; \ /* We define my_sigset() and use that instead of the system sigset() so that we can favor an implementation based on sigaction(). On some systems, such as Mac OS X, sigset() results in flags such as SA_RESTART being set, and we want to make sure that no such flags are set. */ #if defined(HAVE_SIGACTION) && !defined(my_sigset) #define my_sigset(A,B) do { struct sigaction s; sigset_t set; int rc; \ DBUG_ASSERT((A) != 0); \ sigemptyset(&set); \ s.sa_handler = (B); \ s.sa_mask = set; \ s.sa_flags = 0; \ sigaction((A), &s, (struct sigaction *) NULL); \ rc= sigaction((A), &s, (struct sigaction *) NULL); \ DBUG_ASSERT(rc == 0); \ } while (0) #elif defined(HAVE_SIGSET) && !defined(my_sigset) #define my_sigset(A,B) sigset((A),(B)) #elif !defined(my_sigset) #define my_sigset(A,B) signal((A),(B)) #endif #ifndef my_pthread_setprio Loading Loading @@ -416,7 +429,7 @@ struct tm *localtime_r(const time_t *clock, struct tm *res); #undef pthread_detach_this_thread #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } #undef sigset #define sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) #define my_sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) #endif #if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) Loading Loading @@ -663,6 +676,15 @@ extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const)); */ extern pthread_t shutdown_th, main_th, signal_th; /* 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; extern uint thr_client_alarm; /* statistics_xxx functions are for not essential statistic */ #ifndef thread_safe_increment Loading
include/thr_alarm.h +2 −5 Original line number Diff line number Diff line Loading @@ -25,11 +25,6 @@ extern "C" { #ifndef USE_ALARM_THREAD #define USE_ONE_SIGNAL_HAND /* One must call process_alarm */ #endif #ifdef HAVE_LINUXTHREADS #define THR_CLIENT_ALARM SIGALRM #else #define THR_CLIENT_ALARM SIGUSR1 #endif #ifdef HAVE_rts_threads #undef USE_ONE_SIGNAL_HAND #define USE_ALARM_THREAD Loading Loading @@ -98,6 +93,8 @@ typedef struct st_alarm { my_bool malloced; } ALARM; extern uint thr_client_alarm; #define thr_alarm_init(A) (*(A))=0 #define thr_alarm_in_use(A) (*(A)!= 0) void init_thr_alarm(uint max_alarm); Loading