mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 16:46:30 +08:00
Remove some ifdef from wake_sleeping_thread()
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user