-// ThreadsManager::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 return, after which the bestmove and pondermove will be printed.
-
-void ThreadsManager::wait_for_stop_or_ponderhit() {
-
- StopOnPonderhit = true;
-
- Thread& main = threads[0];
-
- lock_grab(&main.sleepLock);
-
- while (!StopRequest)
- cond_wait(&main.sleepCond, &main.sleepLock);
-
- lock_release(&main.sleepLock);
-}
-
-
-// uci_async_command() is called when a 'cmd' input line is received from the
-// GUI while searching.
-
-void uci_async_command(const std::string& cmd) {
-
- if (cmd == "quit" || cmd == "stop")
- StopRequest = true;
-
- else if (cmd == "ponderhit")
- {
- // The opponent has played the expected move. GUI sends "ponderhit" if
- // we were told to ponder on the same move the opponent has played. We
- // should continue searching but switching from pondering to normal search.
- Limits.ponder = false;
-
- if (StopOnPonderhit)
- StopRequest = true;
- }
-}
-
-