The blocking of input during thinking did break pondering, as a ponder
miss also used pause = 2 to schedule ignoring of the 'bestmove' reply
to 'stop'. This now uses pause = 1 again, while after a ponder hit the
input thread is blocked after turning pause into 2, indicating the
'bestmove' is for real.
StopPonder(int pondering)\r
{\r
if(!pondering) return;\r
- pause = 2;\r
+ pause = 1;\r
fprintf(toE, "stop\n"); fflush(toE); DPRINT("# stop\n"); // note: 'pondering' remains set until engine acknowledges 'stop' with 'bestmove'\r
Sync(PAUSE); // wait for engine to acknowledge 'stop' with 'bestmove'.\r
}\r
char *draw = drawOffer ? " draw" : ""; drawOffer = 0;\r
pondering = 0; moveNr++; startTime = GetTickCount(); // clock starts running now\r
fprintf(toE, "ponderhit%s\n", draw); DPRINT("# ponderhit%s\n", draw);\r
+ fflush(toE); fflush(stdout); pause = 2; Sync(PAUSE); // block input during thinking\r
goto nomove;\r
}\r
StopPonder(1);\r