+ if (cmd == "quit" || cmd == "stop")
+ {
+ quit = (token == "quit");
+ Search::Signals.stop = true;
+ Threads[0].wake_up(); // In case is waiting for stop or ponderhit
+ Threads.wait_end_of_search(); // Block here until search finishes
+ }
+
+ 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.
+ Search::Limits.ponder = false; // FIXME racing
+
+ if (Search::Signals.stopOnPonderhit)
+ Search::Signals.stop = true;
+
+ Threads[0].wake_up(); // In case is waiting for stop or ponderhit
+ }