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++;
}
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--;