1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00: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:
Marco Costalba 2012-03-30 12:44:31 +02:00
parent b0b9bb3462
commit d033d5e06a

View file

@ -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")