diff options
| author | unknown <tsmith@quadxeon.mysql.com> | 2007-06-14 23:23:30 +0200 |
|---|---|---|
| committer | unknown <tsmith@quadxeon.mysql.com> | 2007-06-14 23:23:30 +0200 |
| commit | cb93ff4d02ef0b0d3f4722572d8851da5ac9e1bb (patch) | |
| tree | a2e6d7b3fecd15d53e148269e3dbb13aa08370b3 /mysys/my_thr_init.c | |
| parent | 863a953e1d9621d03d17c4c347898a6d09d5aa6f (diff) | |
| parent | dc6c3b31d8c50994ae0b7673ef55437c336daed4 (diff) | |
| download | mariadb-git-cb93ff4d02ef0b0d3f4722572d8851da5ac9e1bb.tar.gz | |
Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0-build
into quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun14/50
configure.in:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/binlog.result:
Auto merged
mysql-test/r/have_log_bin.require:
Auto merged
BitKeeper/deleted/.del-ctype_cp932_notembedded.test:
Auto merged
mysql-test/t/binlog.test:
Auto merged
mysql-test/t/ctype_cp932_binlog.test:
Auto merged
mysql-test/t/ctype_ucs_binlog.test:
Auto merged
mysql-test/t/flush_block_commit_notembedded.test:
Auto merged
mysql-test/t/insert_select-binlog.test:
Auto merged
mysql-test/t/mysqlbinlog-cp932.test:
Auto merged
mysql-test/t/mysqldump.test:
Auto merged
mysql-test/t/sp_trans.test:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
mysql-test/r/mix_innodb_myisam_binlog.result:
Use local
mysql-test/t/blackhole.test:
manual merge
mysql-test/t/drop_temp_table.test:
manual merge
mysql-test/t/mix_innodb_myisam_binlog.test:
Use local
mysql-test/t/mysqlbinlog.test:
Use local
Diffstat (limited to 'mysys/my_thr_init.c')
| -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 |
