summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2014-06-18 18:15:04 +0400
committerSergey Vojtovich <svoj@mariadb.org>2014-06-18 18:15:04 +0400
commitd2a4b78574084cbd1bccfdf4f779bd0dbd13c5a2 (patch)
tree4bc4ff38ae6268f266c7f7e960655ee75d99f2c7 /mysys
parentb6c175aad494ba38d149367b7b890d36c9c09346 (diff)
downloadmariadb-git-d2a4b78574084cbd1bccfdf4f779bd0dbd13c5a2.tar.gz
MDEV-6039 - WebScaleSQL patches
Stop spawning dummy threads on client library initialization Let's revert the fix for Bug#24507. To quote Monty from 2006: "After 1/2 a year, when all glibc versions are updated, we can delete this code." Note: The upstream glibc bug was fixed in 2006.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_thr_init.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index 5007cb01689..d9dbacc8524 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -38,22 +38,6 @@ mysql_mutex_t LOCK_localtime_r;
#ifdef _MSC_VER
static void install_sigabrt_handler();
#endif
-#ifdef TARGET_OS_LINUX
-
-/*
- Dummy thread spawned in my_thread_global_init() below to avoid
- race conditions in NPTL pthread_exit code.
-*/
-
-static pthread_handler_t
-nptl_pthread_exit_hack_handler(void *arg __attribute((unused)))
-{
- /* Do nothing! */
- pthread_exit(0);
- return 0;
-}
-
-#endif /* TARGET_OS_LINUX */
static uint get_thread_lib(void);
@@ -197,33 +181,6 @@ my_bool my_thread_global_init(void)
thd_lib_detected= get_thread_lib();
-#ifdef TARGET_OS_LINUX
- /*
- BUG#24507: Race conditions inside current NPTL pthread_exit()
- implementation.
-
- To avoid a possible segmentation fault during concurrent
- executions of pthread_exit(), a dummy thread is spawned which
- initializes internal variables of pthread lib. See bug description
- for a full explanation.
-
- TODO: Remove this code when fixed versions of glibc6 are in common
- use.
- */
- if (thd_lib_detected == THD_LIB_NPTL)
- {
- pthread_t dummy_thread;
- pthread_attr_t dummy_thread_attr;
-
- pthread_attr_init(&dummy_thread_attr);
- pthread_attr_setdetachstate(&dummy_thread_attr, PTHREAD_CREATE_JOINABLE);
-
- if (pthread_create(&dummy_thread,&dummy_thread_attr,
- nptl_pthread_exit_hack_handler, NULL) == 0)
- (void)pthread_join(dummy_thread, NULL);
- }
-#endif /* TARGET_OS_LINUX */
-
my_thread_init_common_mutex();
return 0;