mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 10:57:43 +00:00
Simplify finished search in ponder/infinite mode.
In this rare case (e.g. go infinite on a stalemate), just spin till ponderhit/stop comes. The Thread::wait() is a renmant of the old YBWC code, today with lazy SMP, threads don't need to wait when outside of their idle loop. No functional change.
This commit is contained in:
committed by
Marco Costalba
parent
66c5eaebd8
commit
2783203428
+6
-6
@@ -277,13 +277,13 @@ void MainThread::search() {
|
||||
// the UCI protocol states that we shouldn't print the best move before the
|
||||
// GUI sends a "stop" or "ponderhit" command. We therefore simply wait here
|
||||
// until the GUI sends one of those commands (which also raises Threads.stop).
|
||||
if (!Threads.stop && (Threads.ponder || Limits.infinite))
|
||||
{
|
||||
Threads.stopOnPonderhit = true;
|
||||
wait(Threads.stop);
|
||||
}
|
||||
Threads.stopOnPonderhit = true;
|
||||
|
||||
// Stop the threads if not already stopped
|
||||
while (!Threads.stop && (Threads.ponder || Limits.infinite))
|
||||
{} // Busy wait for a stop or a ponder reset
|
||||
|
||||
// Stop the threads if not already stopped (also raise the stop if
|
||||
// "ponderhit" just reset Threads.ponder).
|
||||
Threads.stop = true;
|
||||
|
||||
// Wait until all threads have finished
|
||||
|
||||
Reference in New Issue
Block a user