From: H.G.Muller Date: Wed, 7 Jan 2015 16:50:20 +0000 (+0100) Subject: Fix blocking of input in ponder games X-Git-Tag: v2.3~32 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=768046d29eff91d4afbcea23dcb2a623a6a747c9;p=uci2wb.git Fix blocking of input in ponder games 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. --- diff --git a/UCI2WB.c b/UCI2WB.c index 856ada3..9f1ad06 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -157,7 +157,7 @@ void StopPonder(int pondering) { if(!pondering) return; - pause = 2; + pause = 1; fprintf(toE, "stop\n"); fflush(toE); DPRINT("# stop\n"); // note: 'pondering' remains set until engine acknowledges 'stop' with 'bestmove' Sync(PAUSE); // wait for engine to acknowledge 'stop' with 'bestmove'. } @@ -417,6 +417,7 @@ GUI2Engine() char *draw = drawOffer ? " draw" : ""; drawOffer = 0; pondering = 0; moveNr++; startTime = GetTickCount(); // clock starts running now fprintf(toE, "ponderhit%s\n", draw); DPRINT("# ponderhit%s\n", draw); + fflush(toE); fflush(stdout); pause = 2; Sync(PAUSE); // block input during thinking goto nomove; } StopPonder(1);