@@ -44,25 +44,7 @@ pthread_mutexattr_t my_errorcheck_mutexattr;
4444#ifdef _MSC_VER
4545static void install_sigabrt_handler ();
4646#endif
47- #ifdef TARGET_OS_LINUX
4847
49- /*
50- Dummy thread spawned in my_thread_global_init() below to avoid
51- race conditions in NPTL pthread_exit code.
52- */
53-
54- static pthread_handler_t
55- nptl_pthread_exit_hack_handler (void * arg __attribute((unused )))
56- {
57- /* Do nothing! */
58- pthread_exit (0 );
59- return 0 ;
60- }
61-
62- #endif /* TARGET_OS_LINUX */
63-
64-
65- static uint get_thread_lib (void );
6648
6749/** True if @c my_thread_global_init() has been called. */
6850static my_bool my_thread_global_init_done = 0 ;
@@ -179,35 +161,6 @@ my_bool my_thread_global_init(void)
179161 if (my_thread_init ())
180162 return 1 ;
181163
182- thd_lib_detected = get_thread_lib ();
183-
184- #ifdef TARGET_OS_LINUX
185- /*
186- BUG#24507: Race conditions inside current NPTL pthread_exit()
187- implementation.
188-
189- To avoid a possible segmentation fault during concurrent
190- executions of pthread_exit(), a dummy thread is spawned which
191- initializes internal variables of pthread lib. See bug description
192- for a full explanation.
193-
194- TODO: Remove this code when fixed versions of glibc6 are in common
195- use.
196- */
197- if (thd_lib_detected == THD_LIB_NPTL )
198- {
199- pthread_t dummy_thread ;
200- pthread_attr_t dummy_thread_attr ;
201-
202- pthread_attr_init (& dummy_thread_attr );
203- pthread_attr_setdetachstate (& dummy_thread_attr , PTHREAD_CREATE_JOINABLE );
204-
205- if (pthread_create (& dummy_thread ,& dummy_thread_attr ,
206- nptl_pthread_exit_hack_handler , NULL ) == 0 )
207- (void )pthread_join (dummy_thread , NULL );
208- }
209- #endif /* TARGET_OS_LINUX */
210-
211164 mysql_mutex_init (key_THR_LOCK_lock , & THR_LOCK_lock , MY_MUTEX_INIT_FAST );
212165 mysql_mutex_init (key_THR_LOCK_myisam , & THR_LOCK_myisam , MY_MUTEX_INIT_SLOW );
213166 mysql_mutex_init (key_THR_LOCK_myisam_mmap , & THR_LOCK_myisam_mmap , MY_MUTEX_INIT_FAST );
@@ -490,21 +443,6 @@ extern void **my_thread_var_dbug()
490443#endif /* DBUG_OFF */
491444
492445
493- static uint get_thread_lib (void )
494- {
495- #ifdef _CS_GNU_LIBPTHREAD_VERSION
496- char buff [64 ];
497-
498- confstr (_CS_GNU_LIBPTHREAD_VERSION , buff , sizeof (buff ));
499-
500- if (!strncasecmp (buff , "NPTL" , 4 ))
501- return THD_LIB_NPTL ;
502- if (!strncasecmp (buff , "linuxthreads" , 12 ))
503- return THD_LIB_LT ;
504- #endif
505- return THD_LIB_OTHER ;
506- }
507-
508446#ifdef _WIN32
509447/*
510448 In Visual Studio 2005 and later, default SIGABRT handler will overwrite
0 commit comments