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:
parent
47b5242930
commit
17f96bc641
1 changed files with 5 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue