-
-// Thread::wake_up() wakes up the thread, normally at the beginning of the search
-// or, if "sleeping threads" is used at split time.
-
-void Thread::wake_up() {
-
- mutex.lock();
- sleepCondition.notify_one();
- mutex.unlock();
-}
-
-
-// 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
-// then return, after which the bestmove and pondermove will be printed.
-
-void Thread::wait_for_stop_or_ponderhit() {
-
- Signals.stopOnPonderhit = true;
-
- mutex.lock();
- while (!Signals.stop) sleepCondition.wait(mutex);;
- mutex.unlock();