diff options
author | Jon Olav Hauglid <jon.hauglid@oracle.com> | 2014-06-12 12:35:55 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2020-03-10 19:24:21 +0100 |
commit | 52d7980753305261c4d9123f89bd78fa76527b03 (patch) | |
tree | dd1dda72d9aeedc29bd5a48a8af418294869393e /mysys | |
parent | 17ea240f6b683412bd231c15105c533b3cc81de5 (diff) | |
download | mariadb-git-52d7980753305261c4d9123f89bd78fa76527b03.tar.gz |
Bug#18913935: REMOVE SUPPORT FOR LINUXTHREADS
This patch removes support for LinuxThreads.
It was superseded by NPTL in Linux 2.6 (2003).
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_pthread.c | 2 | ||||
-rw-r--r-- | mysys/my_thr_init.c | 20 | ||||
-rw-r--r-- | mysys/stacktrace.c | 4 | ||||
-rw-r--r-- | mysys/thr_alarm.c | 29 |
4 files changed, 4 insertions, 51 deletions
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index ac6d3f87de3..c1567f2cd03 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -29,8 +29,6 @@ #define SCHED_POLICY SCHED_OTHER #endif -uint thd_lib_detected= 0; - /* Some functions for RTS threads, AIX, Siemens Unix and UnixWare 7 (and DEC OSF/1 3.2 too) diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index b298c7b1bd7..1f84809e50f 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -39,9 +39,6 @@ mysql_mutex_t LOCK_localtime_r; static void install_sigabrt_handler(); #endif - -static uint get_thread_lib(void); - /** True if @c my_thread_global_init() has been called. */ static my_bool my_thread_global_init_done= 0; /* True if THR_KEY_mysys is created */ @@ -96,7 +93,6 @@ static void my_thread_init_internal_mutex(void) mysql_cond_init(key_THR_COND_threads, &THR_COND_threads, NULL); } - void my_thread_destroy_internal_mutex(void) { mysql_mutex_destroy(&THR_LOCK_threads); @@ -190,7 +186,6 @@ my_bool my_thread_global_init(void) if (my_thread_init()) return 1; - thd_lib_detected= get_thread_lib(); my_thread_init_common_mutex(); @@ -455,21 +450,6 @@ safe_mutex_t **my_thread_var_mutex_in_use() return tmp ? &tmp->mutex_in_use : 0; } -static uint get_thread_lib(void) -{ -#ifdef _CS_GNU_LIBPTHREAD_VERSION - char buff[64]; - - 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; -} - #ifdef _WIN32 /* In Visual Studio 2005 and later, default SIGABRT handler will overwrite diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index 19dcdf11dd5..958ca506c59 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -438,8 +438,8 @@ void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack, :"r"(pc)); #endif /* __alpha__ */ - /* We are 1 frame above signal frame with NPTL and 2 frames above with LT */ - sigreturn_frame_count = thd_lib_detected == THD_LIB_LT ? 2 : 1; + /* We are 1 frame above signal frame with NPTL */ + sigreturn_frame_count = 1; while (fp < (uchar**) stack_bottom) { diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index 553dc55bfc3..9bc70b283cb 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -95,16 +95,8 @@ void init_thr_alarm(uint max_alarms) sigfillset(&full_signal_set); /* Neaded to block signals */ mysql_mutex_init(key_LOCK_alarm, &LOCK_alarm, MY_MUTEX_INIT_FAST); mysql_cond_init(key_COND_alarm, &COND_alarm, NULL); - if (thd_lib_detected == THD_LIB_LT) - thr_client_alarm= SIGALRM; - else - thr_client_alarm= SIGUSR1; -#ifndef USE_ALARM_THREAD - if (thd_lib_detected != THD_LIB_LT) -#endif - { - my_sigset(thr_client_alarm, thread_alarm); - } + thr_client_alarm= SIGUSR1; + my_sigset(thr_client_alarm, thread_alarm); sigemptyset(&s); sigaddset(&s, THR_SERVER_ALARM); alarm_thread=pthread_self(); @@ -121,11 +113,6 @@ void init_thr_alarm(uint max_alarms) } #elif defined(USE_ONE_SIGNAL_HAND) pthread_sigmask(SIG_BLOCK, &s, NULL); /* used with sigwait() */ - if (thd_lib_detected == THD_LIB_LT) - { - my_sigset(thr_client_alarm, process_alarm); /* Linuxthreads */ - pthread_sigmask(SIG_UNBLOCK, &s, NULL); - } #else my_sigset(THR_SERVER_ALARM, process_alarm); pthread_sigmask(SIG_UNBLOCK, &s, NULL); @@ -286,18 +273,6 @@ 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 */ - if (thd_lib_detected == THD_LIB_LT && - !pthread_equal(pthread_self(),alarm_thread)) - { -#if defined(MAIN) && !defined(__bsdi__) - printf("thread_alarm in process_alarm\n"); fflush(stdout); -#endif -#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY - my_sigset(thr_client_alarm, process_alarm); /* int. thread system calls */ -#endif - return; - } - /* We have to do do the handling of the alarm in a sub function, because otherwise we would get problems with two threads calling |