mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 10:06:26 +08:00
Simplify finished search in ponder/infinite mode.
In this rare case (e.g. go infinite on a stalemate), just spin till ponderhit/stop comes. The Thread::wait() is a renmant of the old YBWC code, today with lazy SMP, threads don't need to wait when outside of their idle loop. No functional change.
This commit is contained in:
committed by
Marco Costalba
parent
66c5eaebd8
commit
2783203428
@@ -68,24 +68,12 @@ void Thread::wait_for_search_finished() {
|
||||
}
|
||||
|
||||
|
||||
/// Thread::wait() waits on sleep condition until condition is true
|
||||
|
||||
void Thread::wait(std::atomic_bool& condition) {
|
||||
|
||||
std::unique_lock<Mutex> lk(mutex);
|
||||
sleepCondition.wait(lk, [&]{ return bool(condition); });
|
||||
}
|
||||
|
||||
|
||||
/// Thread::start_searching() wakes up the thread that will start the search
|
||||
|
||||
void Thread::start_searching(bool resume) {
|
||||
void Thread::start_searching() {
|
||||
|
||||
std::unique_lock<Mutex> lk(mutex);
|
||||
|
||||
if (!resume)
|
||||
searching = true;
|
||||
|
||||
searching = true;
|
||||
sleepCondition.notify_one();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user