fixed semaphore behavior on windows. Closes #926. Closes #934.

This commit is contained in:
oy 2012-07-21 18:53:09 +02:00
parent 96d30fa820
commit 7d8e76ecaf

View file

@ -513,7 +513,7 @@ void lock_release(LOCK lock)
void semaphore_destroy(SEMAPHORE *sem) { sem_destroy(sem); }
#elif defined(CONF_FAMILY_WINDOWS)
void semaphore_init(SEMAPHORE *sem) { *sem = CreateSemaphore(0, 0, 10000, 0); }
void semaphore_wait(SEMAPHORE *sem) { WaitForSingleObject((HANDLE)*sem, 0L); }
void semaphore_wait(SEMAPHORE *sem) { WaitForSingleObject((HANDLE)*sem, INFINITE); }
void semaphore_signal(SEMAPHORE *sem) { ReleaseSemaphore((HANDLE)*sem, 1, NULL); }
void semaphore_destroy(SEMAPHORE *sem) { CloseHandle((HANDLE)*sem); }
#else