1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

Revert "Delay waiting for threads to finish"

This reverts commit 35e649d70d6426a311325de221af797f864d171b.

We need to be sure all threads are finished before sending 'bestmove'.
This commit is contained in:
Gary Linscott 2015-10-11 03:10:34 +08:00 committed by Marco Costalba
parent 47b5242930
commit 17f96bc641

View file

@ -306,6 +306,11 @@ void MainThread::think() {
// Stop the threads and the timer
Signals.stop = true;
Threads.timer->run = false;
// Wait until all threads have finished
for (Thread* th : Threads)
if (th != this)
th->wait_while(th->searching);
}
// When playing in 'nodes as time' mode, subtract the searched nodes from
@ -330,12 +335,6 @@ void MainThread::think() {
std::cout << " ponder " << UCI::move(rootMoves[0].pv[1], pos.is_chess960());
std::cout << sync_endl;
// Wait until all threads have finished before returning. Best move is already
// sent, so this waiting time is not accounted.
for (Thread* th : Threads)
if (th != this)
th->wait_while(th->searching);
}