X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=threads.c;h=8921204b3c2eef6ac917297c564664dfe13731ad;hb=01021030a4e2b351e9ce5f5af13aaf1c14ba0648;hp=f2f2703c4f681eaa81737c5855f9308db4172911;hpb=4e8fa1efca3c71ef7e0c515afb175e849a97d416;p=platform%2Fupstream%2Flibxml2.git diff --git a/threads.c b/threads.c index f2f2703..8921204 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,8 +414,10 @@ xmlRMutexUnlock(xmlRMutexPtr tok ATTRIBUTE_UNUSED) } pthread_mutex_unlock(&tok->lock); #elif defined HAVE_WIN32_THREADS - if (!--tok->count) + if (tok->count > 0) { LeaveCriticalSection(&tok->cs); + tok->count--; + } #elif defined HAVE_BEOS_THREADS if (tok->lock->tid == find_thread(NULL)) { tok->count--;