summaryrefslogtreecommitdiff
path: root/mysys/charset.c
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2010-02-26 23:09:36 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2010-02-26 23:09:36 -0300
commita3f59677f886a45e0d0b1b5cf0225966ecf6ee15 (patch)
tree74ef9987f54e39eb4ac1d3dbbc1a6bb57637f1db /mysys/charset.c
parent684b293c22c595c780567eb50b3fcdb73f56e002 (diff)
downloadmariadb-git-a3f59677f886a45e0d0b1b5cf0225966ecf6ee15.tar.gz
Workaround the pthread_once_t static initialization. Per the
POSIX standard, reinitialization of a pthread_once is a gray area, but it is needed to support subsequent initializations of the client library. mysys/charset.c: Reinitialize a pthread_once_t variable.
Diffstat (limited to 'mysys/charset.c')
-rw-r--r--mysys/charset.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mysys/charset.c b/mysys/charset.c
index 584b33b2d6a..9678febc9ba 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -400,6 +400,7 @@ static void *cs_alloc(size_t size)
static my_pthread_once_t charsets_initialized= MY_PTHREAD_ONCE_INIT;
+static my_pthread_once_t charsets_template= MY_PTHREAD_ONCE_INIT;
static void init_available_charsets(void)
{
@@ -429,7 +430,7 @@ static void init_available_charsets(void)
void free_charsets(void)
{
- charsets_initialized= MY_PTHREAD_ONCE_INIT;
+ charsets_initialized= charsets_template;
}
uint get_collation_number(const char *name)