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:
parent
389edb8099
commit
472971f851
2 changed files with 5 additions and 10 deletions
|
@ -34,6 +34,7 @@ typedef pthread_cond_t WaitCondition;
|
||||||
# define lock_release(x) pthread_mutex_unlock(x)
|
# define lock_release(x) pthread_mutex_unlock(x)
|
||||||
# define lock_destroy(x) pthread_mutex_destroy(x)
|
# define lock_destroy(x) pthread_mutex_destroy(x)
|
||||||
# define cond_destroy(x) pthread_cond_destroy(x);
|
# define cond_destroy(x) pthread_cond_destroy(x);
|
||||||
|
# define cond_signal(x) pthread_cond_signal(x);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -49,6 +50,7 @@ typedef HANDLE WaitCondition;
|
||||||
# define lock_release(x) LeaveCriticalSection(x)
|
# define lock_release(x) LeaveCriticalSection(x)
|
||||||
# define lock_destroy(x) DeleteCriticalSection(x)
|
# define lock_destroy(x) DeleteCriticalSection(x)
|
||||||
# define cond_destroy(x) CloseHandle(*x);
|
# define cond_destroy(x) CloseHandle(*x);
|
||||||
|
# define cond_signal(x) SetEvent(*x);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -2562,16 +2562,9 @@ split_point_start: // At split points actual search starts from here
|
||||||
|
|
||||||
void ThreadsManager::wake_sleeping_thread(int threadID) {
|
void ThreadsManager::wake_sleeping_thread(int threadID) {
|
||||||
|
|
||||||
assert(threadID > 0);
|
lock_grab(&WaitLock);
|
||||||
assert(threads[threadID].state == THREAD_AVAILABLE);
|
cond_signal(&WaitCond[threadID]);
|
||||||
|
lock_release(&WaitLock);
|
||||||
#if !defined(_MSC_VER)
|
|
||||||
pthread_mutex_lock(&WaitLock);
|
|
||||||
pthread_cond_signal(&WaitCond[threadID]);
|
|
||||||
pthread_mutex_unlock(&WaitLock);
|
|
||||||
#else
|
|
||||||
SetEvent(WaitCond[threadID]);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue