mariadb/netware
Staale Smedseng 8969530cff Bug #45058 init_available_charsets uses double checked locking
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().
2009-12-12 19:11:25 +01:00
..
BUILD Merge up from 5.0-build 2009-02-04 04:54:05 +01:00
comp_err.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
install_test_db.ncf Many files: 2003-02-01 00:42:26 +01:00
libmysql.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
libmysqlmain.c Bug #45058 init_available_charsets uses double checked locking 2009-12-12 19:11:25 +01:00
Makefile.am Auto-merge up from 5.0 2009-02-07 16:50:31 +01:00
my_manage.c A patch for Netware. 2005-01-13 19:24:54 +02:00
my_manage.h Several Netware specific fixes. 2006-02-02 16:22:31 +02:00
my_print_defaults.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
myisam_ftdump.def myisampack.def, myisamlog.def, myisam_ftdump.def, myisamchk.def: 2006-12-02 04:25:41 +01:00
myisamchk.def myisampack.def, myisamlog.def, myisam_ftdump.def, myisamchk.def: 2006-12-02 04:25:41 +01:00
myisamlog.def myisampack.def, myisamlog.def, myisam_ftdump.def, myisamchk.def: 2006-12-02 04:25:41 +01:00
myisampack.def myisampack.def, myisamlog.def, myisam_ftdump.def, myisamchk.def: 2006-12-02 04:25:41 +01:00
mysql.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
mysql.xdc New XDC file for NetWare pre-emption 2003-03-31 18:09:13 -05:00
mysql_client_test.def Makefile.am: 2006-12-02 06:06:31 +01:00
mysql_fix_privilege_tables.pl Many files: 2006-12-23 20:17:15 +01:00
mysql_install_db.c Merge from 5.0-bugteam local. 2008-08-18 13:33:00 -04:00
mysql_install_db.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
mysql_secure_installation.pl Many files: 2006-12-23 20:17:15 +01:00
mysql_test_run.c Merge trift2.:/MySQL/M50/merge-5.0 2007-12-21 13:13:22 +01:00
mysql_test_run.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
mysql_upgrade.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
mysql_waitpid.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
mysqladmin.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
mysqlbinlog.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
mysqlcheck.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
mysqld.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
mysqld_safe.c sp_head.cc: 2007-12-14 18:23:11 +01:00
mysqld_safe.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
mysqldump.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
mysqlimport.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
mysqlshow.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
mysqlslap.def mysql.spec.sh, make_binary_distribution.sh, Makefile.am, mysql.sln: 2005-12-19 01:12:11 +01:00
mysqltest.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
perror.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
replace.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
resolve_stack_dump.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
resolveip.def mysql_upgrade.def Makefile.am: 2006-12-01 23:09:14 +01:00
static_init_db.sql Changed prototype of killed_ptr() to make it more portable 2004-05-26 19:12:49 +03:00