1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +03:00

Fix a thread portability problem

cannot compile libxml2-2.9.0 using studio 12.1 compiler on solaris 10

I.M.O. structure initializer (as PTHREAD_ONCE_INIT) cannot be used in
a structure assignment anyway
This commit is contained in:
Friedrich Haubensak 2012-09-12 17:34:53 +02:00 committed by Daniel Veillard
parent e7715a5963
commit 3f6cfbd1d3

View File

@ -146,6 +146,7 @@ struct _xmlRMutex {
static pthread_key_t globalkey;
static pthread_t mainthread;
static pthread_once_t once_control = PTHREAD_ONCE_INIT;
static pthread_once_t once_control_init = PTHREAD_ONCE_INIT;
static pthread_mutex_t global_init_lock = PTHREAD_MUTEX_INITIALIZER;
#elif defined HAVE_WIN32_THREADS
#if defined(HAVE_COMPILER_TLS)
@ -915,7 +916,7 @@ xmlCleanupThreads(void)
#ifdef HAVE_PTHREAD_H
if ((libxml_is_threaded) && (pthread_key_delete != NULL))
pthread_key_delete(globalkey);
once_control = PTHREAD_ONCE_INIT;
once_control = once_control_init;
#elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
if (globalkey != TLS_OUT_OF_INDEXES) {
xmlGlobalStateCleanupHelperParams *p;