diff options
author | Aron Xu <aron@debian.org> | 2012-09-18 01:15:22 +0800 |
---|---|---|
committer | Aron Xu <aron@debian.org> | 2012-09-18 01:15:22 +0800 |
commit | f660f9d2924c7549bc87e7f9b4ece7c9727b3682 (patch) | |
tree | 816b3ef0e89d1601803b5dc1b90b50ade0567043 /threads.c | |
parent | d7372d053bbd1d58216fbb04d1771ffa4cc3e624 (diff) | |
download | libxml2-f660f9d2924c7549bc87e7f9b4ece7c9727b3682.tar.gz |
Imported Upstream version 2.9.0upstream/2.9.0
Diffstat (limited to 'threads.c')
-rw-r--r-- | threads.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -439,7 +439,7 @@ __xmlGlobalInitMutexLock(void) /* Make sure the global init lock is initialized and then lock it. */ #ifdef HAVE_PTHREAD_H /* The mutex is statically initialized, so we just lock it. */ - if (pthread_mutex_lock) + if (pthread_mutex_lock != NULL) pthread_mutex_lock(&global_init_lock); #elif defined HAVE_WIN32_THREADS LPCRITICAL_SECTION cs; @@ -509,7 +509,7 @@ void __xmlGlobalInitMutexUnlock(void) { #ifdef HAVE_PTHREAD_H - if (pthread_mutex_unlock) + if (pthread_mutex_unlock != NULL) pthread_mutex_unlock(&global_init_lock); #elif defined HAVE_WIN32_THREADS if (global_init_lock != NULL) { @@ -915,6 +915,7 @@ xmlCleanupThreads(void) #ifdef HAVE_PTHREAD_H if ((libxml_is_threaded) && (pthread_key_delete != NULL)) pthread_key_delete(globalkey); + once_control = PTHREAD_ONCE_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; |