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
install_test_db.ncf
libmysql.def
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
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 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_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
mysql_waitpid.def
mysqladmin.def
mysqlbinlog.def
mysqlcheck.def
mysqld.def
mysqld_safe.c sp_head.cc: 2007-12-14 18:23:11 +01:00
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