From: Marco Costalba Date: Fri, 30 Mar 2012 10:44:31 +0000 (+0200) Subject: Revert "Call wait_for_search_finished() only when quitting" X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=d033d5e06a604f601b157cb3d2a8450c5dc00474 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 --- diff --git a/src/uci.cpp b/src/uci.cpp index c3eb9190..fc02cf60 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -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")