Commit c98d6e5b authored by unknown's avatar unknown

Merge pilot.(none):/data/msvensson/mysql/bug28690/my50-bug28690

into  pilot.(none):/data/msvensson/mysql/mysql-5.0-maint

parents 703308a6 bfb7b569
...@@ -87,27 +87,31 @@ my_bool my_thread_global_init(void) ...@@ -87,27 +87,31 @@ my_bool my_thread_global_init(void)
fprintf(stderr,"Can't initialize threads: error %d\n", pth_ret); fprintf(stderr,"Can't initialize threads: error %d\n", pth_ret);
return 1; return 1;
} }
#ifdef NPTL_PTHREAD_EXIT_BUG
/*
BUG#24507: Race conditions inside current NPTL pthread_exit() implementation.
To avoid a possible segmentation fault during concurrent executions of #ifdef NPTL_PTHREAD_EXIT_BUG
pthread_exit(), a dummy thread is spawned which initializes internal variables /*
of pthread lib. See bug description for thoroughfull explanation. BUG#24507: Race conditions inside current NPTL pthread_exit()
implementation.
TODO: Remove this code when fixed versions of glibc6 are in common use.
*/
pthread_t dummy_thread; To avoid a possible segmentation fault during concurrent
pthread_attr_t dummy_thread_attr; executions of pthread_exit(), a dummy thread is spawned which
initializes internal variables of pthread lib. See bug description
for a full explanation.
pthread_attr_init(&dummy_thread_attr); TODO: Remove this code when fixed versions of glibc6 are in common
pthread_attr_setdetachstate(&dummy_thread_attr,PTHREAD_CREATE_DETACHED); use.
*/
if (thd_lib_detected == THD_LIB_NPTL)
{
pthread_t dummy_thread;
pthread_attr_t dummy_thread_attr;
pthread_create(&dummy_thread,&dummy_thread_attr,nptl_pthread_exit_hack_handler,NULL); pthread_attr_init(&dummy_thread_attr);
pthread_attr_setdetachstate(&dummy_thread_attr, PTHREAD_CREATE_DETACHED);
pthread_create(&dummy_thread,&dummy_thread_attr,
nptl_pthread_exit_hack_handler, NULL);
}
#endif #endif
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment