mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 08:36:33 +08:00
Async 'stop' command
Don't wait for the search to finish after a 'stop' command, but keep processing the GUI input if any. Also explicitly wake up the main thread (that could be sleeping) after a 'stop' or 'quit' command and do not rely on wait_for_search_finished() doing it for us. This patch cleans up the code and functions's definitions, but it is risky and needs a good test under different conditions to be sure it does not introduces hungs up. No functional change.
This commit is contained in:
@@ -404,7 +404,6 @@ void ThreadPool::wait_for_search_finished() {
|
||||
|
||||
Thread* t = main_thread();
|
||||
t->mutex.lock();
|
||||
t->sleepCondition.notify_one(); // In case is waiting for stop or ponderhit
|
||||
while (!t->do_sleep) sleepCondition.wait(t->mutex);
|
||||
t->mutex.unlock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user