summaryrefslogtreecommitdiff
path: root/threads.c
diff options
context:
space:
mode:
authorRaphaël Hertzog <hertzog@debian.org>2015-08-25 21:55:54 +0200
committerRaphaël Hertzog <hertzog@debian.org>2015-08-25 21:55:54 +0200
commit7300193becde71a344c8ac0973dc290fa24d800d (patch)
tree6490c364e7764294c209e536d42f3d31d23ebc0d /threads.c
parent3871a83a5f0aebd8c00879eab14fe901c93dbfcf (diff)
downloadlibxml2-7300193becde71a344c8ac0973dc290fa24d800d.tar.gz
Imported Upstream version 2.9.1+dfsg1
Diffstat (limited to 'threads.c')
-rw-r--r--threads.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/threads.c b/threads.c
index 8921204..f2f2703 100644
--- a/threads.c
+++ b/threads.c
@@ -378,7 +378,7 @@ xmlRMutexLock(xmlRMutexPtr tok)
pthread_mutex_unlock(&tok->lock);
#elif defined HAVE_WIN32_THREADS
EnterCriticalSection(&tok->cs);
- tok->count++;
+ ++tok->count;
#elif defined HAVE_BEOS_THREADS
if (tok->lock->tid == find_thread(NULL)) {
tok->count++;
@@ -414,10 +414,8 @@ xmlRMutexUnlock(xmlRMutexPtr tok ATTRIBUTE_UNUSED)
}
pthread_mutex_unlock(&tok->lock);
#elif defined HAVE_WIN32_THREADS
- if (tok->count > 0) {
+ if (!--tok->count)
LeaveCriticalSection(&tok->cs);
- tok->count--;
- }
#elif defined HAVE_BEOS_THREADS
if (tok->lock->tid == find_thread(NULL)) {
tok->count--;