mirror of
https://github.com/MariaDB/server.git
synced 2026-04-18 22:35:33 +02:00
As documented in the bug report, the double checked locking pattern has inherent issues, and cannot guarantee correct initialization. This patch replaces the logic in init_available_charsets() with the use of pthread_once(3). A wrapper function, my_pthread_once(), is introduced and is used in lieu of direct calls to init_available_charsets(). Related defines MY_PTHREAD_ONCE_* are also introduced. For the Windows platform, the implementation in lp:sysbench is ported. For single-thread use, a simple define calls the function and sets the pthread_once control variable. Charset initialization is modified to use my_pthread_once(). include/my_no_pthread.h: Dummy my_pthread_once() for single thread use. include/my_pthread.h: Declaration for new function my_pthread_once(). mysys/charset.c: Logic in init_available_charsets() is simplified. Using my_pthread_once() for all calls to this func. mysys/my_winthread.c: Windows implementation of my_pthread_once(). |
||
|---|---|---|
| .. | ||
| BUILD | ||
| comp_err.def | ||
| install_test_db.ncf | ||
| libmysql.def | ||
| libmysqlmain.c | ||
| Makefile.am | ||
| my_manage.c | ||
| my_manage.h | ||
| my_print_defaults.def | ||
| myisam_ftdump.def | ||
| myisamchk.def | ||
| myisamlog.def | ||
| myisampack.def | ||
| mysql.def | ||
| mysql.xdc | ||
| mysql_client_test.def | ||
| mysql_fix_privilege_tables.pl | ||
| mysql_install_db.c | ||
| mysql_install_db.def | ||
| mysql_secure_installation.pl | ||
| mysql_test_run.c | ||
| mysql_test_run.def | ||
| mysql_upgrade.def | ||
| mysql_waitpid.def | ||
| mysqladmin.def | ||
| mysqlbinlog.def | ||
| mysqlcheck.def | ||
| mysqld.def | ||
| mysqld_safe.c | ||
| mysqld_safe.def | ||
| mysqldump.def | ||
| mysqlimport.def | ||
| mysqlshow.def | ||
| mysqlslap.def | ||
| mysqltest.def | ||
| perror.def | ||
| replace.def | ||
| resolve_stack_dump.def | ||
| resolveip.def | ||
| static_init_db.sql | ||