X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fthread.cpp;h=5f3b4d314bfb2b6edf27d65dec92b47d6dfafa96;hb=78a953177397f3eb85cfee4398975e8519895e6b;hp=bc0b3fcc3227b3a5c128256eafed6bf0852ad1e4;hpb=d1143794a01cd0540cf47e3415815cd60cde9422;p=stockfish diff --git a/src/thread.cpp b/src/thread.cpp index bc0b3fcc..5f3b4d31 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -76,9 +76,10 @@ void TimerThread::idle_loop() { while (!do_exit) { mutex.lock(); - while (!msec && !do_exit) - sleepCondition.wait_for(mutex, msec ? msec : INT_MAX); + do sleepCondition.wait_for(mutex, msec ? msec : INT_MAX); + while (!msec && !do_exit); // Don't allow wakeups when msec = 0 mutex.unlock(); + check_time(); } }