- // 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 wait_for_stop_or_ponderhit() {
-
- string cmd;
- StopOnPonderhit = true;
-
- while (!StopRequest)
- {
- Threads.getline(cmd);
- do_uci_async_cmd(cmd);
- }
- }
-
-