mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-16 23:26:23 +08:00
Revert "Call wait_for_search_finished() only when quitting"
We need to wake up main thread if it is sleeping waiting for stop or ponderhit, so we cannot skip calling wait_for_search_finished(). Found by Othello1984. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -69,9 +69,7 @@ void uci_loop() {
|
||||
if (token == "quit" || token == "stop")
|
||||
{
|
||||
Search::Signals.stop = true;
|
||||
|
||||
if (token == "quit") // Cannot quit while threads are still running
|
||||
Threads.wait_for_search_finished();
|
||||
Threads.wait_for_search_finished(); // Cannot quit while threads are running
|
||||
}
|
||||
|
||||
else if (token == "ponderhit")
|
||||
@@ -82,7 +80,10 @@ void uci_loop() {
|
||||
Search::Limits.ponder = false;
|
||||
|
||||
if (Search::Signals.stopOnPonderhit)
|
||||
{
|
||||
Search::Signals.stop = true;
|
||||
Threads.wait_for_search_finished(); // Wake up if is sleeping
|
||||
}
|
||||
}
|
||||
|
||||
else if (token == "go")
|
||||
|
||||
Reference in New Issue
Block a user