diff options
author | unknown <msvensson@pilot.(none)> | 2007-06-07 10:00:23 +0200 |
---|---|---|
committer | unknown <msvensson@pilot.(none)> | 2007-06-07 10:00:23 +0200 |
commit | c98d6e5b5ba8010cac6e9adb162ec88de2537163 (patch) | |
tree | b400c1ca6aeafdbaa5432710ace5645aa5909544 /mysys | |
parent | 703308a65aed7857a3c97711d6e74834a9b09b7a (diff) | |
parent | bfb7b5690185c025548d076af5077cb2f5ab573c (diff) | |
download | mariadb-git-c98d6e5b5ba8010cac6e9adb162ec88de2537163.tar.gz |
Merge pilot.(none):/data/msvensson/mysql/bug28690/my50-bug28690
into pilot.(none):/data/msvensson/mysql/mysql-5.0-maint
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_thr_init.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index 07a92e34dd3..cf7ea0a800f 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -87,27 +87,31 @@ my_bool my_thread_global_init(void) fprintf(stderr,"Can't initialize threads: error %d\n", pth_ret); 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 - pthread_exit(), a dummy thread is spawned which initializes internal variables - of pthread lib. See bug description for thoroughfull explanation. - - TODO: Remove this code when fixed versions of glibc6 are in common use. -*/ +#ifdef NPTL_PTHREAD_EXIT_BUG + /* + BUG#24507: Race conditions inside current NPTL pthread_exit() + implementation. - pthread_t dummy_thread; - pthread_attr_t dummy_thread_attr; + 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. - pthread_attr_init(&dummy_thread_attr); - pthread_attr_setdetachstate(&dummy_thread_attr,PTHREAD_CREATE_DETACHED); + 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_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 #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP |