X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fthread.cpp;h=180869c6191d0d909d131fe2a8d5e1cc59f1c821;hp=b599960528a00d2e67c0948d9a93146a04e14023;hb=89a89eb60535a72139730ecd60b6e1257db269d4;hpb=3b14b17664b30933e55d0fb1c8248ddab8b49110 diff --git a/src/thread.cpp b/src/thread.cpp index b5999605..180869c6 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -131,16 +131,14 @@ void Thread::wake_up() { } -// Thread::wait_for_stop_or_ponderhit() is called when the maximum depth is -// reached while the program is pondering. The point is to work around a wrinkle -// in the UCI protocol: When pondering, the engine is not allowed to give a -// "bestmove" before the GUI sends it a "stop" or "ponderhit" command. We simply -// wait here until one of these commands (that raise StopRequest) is sent and +// Thread::wait_for_stop() is called when the maximum depth is reached while +// the program is pondering. The point is to work around a wrinkle in the UCI +// protocol: When pondering, the engine is not allowed to give a "bestmove" +// before the GUI sends it a "stop" or "ponderhit" command. We simply wait here +// until one of these commands (that raise Signals.stop) is sent and // then return, after which the bestmove and pondermove will be printed. -void Thread::wait_for_stop_or_ponderhit() { - - Signals.stopOnPonderhit = true; +void Thread::wait_for_stop() { mutex.lock(); while (!Signals.stop) sleepCondition.wait(mutex);