Skip to content
Snippets Groups Projects
Commit c47fcdf9 authored by rswindell's avatar rswindell
Browse files

Fixed Win32 CriticalSection implementation of pthread_mutex_unlock()

(can't rely on LockCount).
parent 19cafa8b
No related branches found
No related tags found
No related merge requests found
......@@ -70,11 +70,11 @@ extern "C" {
/* No Win32 implementation for sem_getvalue() */
/* POSIX mutexes */
#if 0 /* Implemented as Win32 Critical Sections */
#if 1 /* Implemented as Win32 Critical Sections */
typedef CRITICAL_SECTION pthread_mutex_t;
#define pthread_mutex_init(pmtx,v) InitializeCriticalSection(pmtx)
#define pthread_mutex_lock(pmtx) EnterCriticalSection(pmtx)
#define pthread_mutex_unlock(pmtx) if((pmtx)->LockCount) LeaveCriticalSection(pmtx)
#define pthread_mutex_unlock(pmtx) LeaveCriticalSection(pmtx)
#define pthread_mutex_destroy(pmtx) DeleteCriticalSection(pmtx)
#else /* Implemented as Win32 Mutexes (much slower) */
typedef HANDLE pthread_mutex_t;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment