1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Remove some ifdef from wake_sleeping_thread()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-10-17 09:34:23 +01:00
parent 389edb8099
commit 472971f851
2 changed files with 5 additions and 10 deletions

View file

@ -34,6 +34,7 @@ typedef pthread_cond_t WaitCondition;
# define lock_release(x) pthread_mutex_unlock(x)
# define lock_destroy(x) pthread_mutex_destroy(x)
# define cond_destroy(x) pthread_cond_destroy(x);
# define cond_signal(x) pthread_cond_signal(x);
#else
@ -49,6 +50,7 @@ typedef HANDLE WaitCondition;
# define lock_release(x) LeaveCriticalSection(x)
# define lock_destroy(x) DeleteCriticalSection(x)
# define cond_destroy(x) CloseHandle(*x);
# define cond_signal(x) SetEvent(*x);
#endif

View file

@ -2562,16 +2562,9 @@ split_point_start: // At split points actual search starts from here
void ThreadsManager::wake_sleeping_thread(int threadID) {
assert(threadID > 0);
assert(threads[threadID].state == THREAD_AVAILABLE);
#if !defined(_MSC_VER)
pthread_mutex_lock(&WaitLock);
pthread_cond_signal(&WaitCond[threadID]);
pthread_mutex_unlock(&WaitLock);
#else
SetEvent(WaitCond[threadID]);
#endif
lock_grab(&WaitLock);
cond_signal(&WaitCond[threadID]);
lock_release(&WaitLock);
}