Remove possible deadlock
[uci2wb.git] / UCI2WB.c
index eeb93c3..1944b4b 100644 (file)
--- a/UCI2WB.c
+++ b/UCI2WB.c
@@ -246,7 +246,6 @@ Engine2GUI()
            sscanf(line, "bestmove %s", move[moveNr++]);\r
            myTime -= (GetTickCount() - startTime)*1.02 + inc; // update own clock, so we can give correct wtime, btime with ponder\r
            if(mps && ((moveNr+1)/2) % mps == 0) myTime += tc; if(sTime) myTime = sTime; // new session or move starts\r
-\r
            stm = WHITE+BLACK - stm;\r
            // first start a new ponder search, if pondering is on and we have a move to ponder on\r
            if(p = strstr(line+9, "ponder")) {\r
@@ -368,7 +367,7 @@ GUI2Engine()
 \r
        if((computer == stm || computer == ANALYZE) && !suspended) {\r
            DPRINT("# start search\n");\r
-           LoadPos(moveNr); // load position\r
+           LoadPos(moveNr); fflush(stdout); // load position\r
            // and set engine thinking (note USI swaps colors!)\r
            startTime = GetTickCount();\r
            if(computer == ANALYZE) {\r
@@ -395,7 +394,7 @@ GUI2Engine()
            if(sc == 'x') { if(newGame) fprintf(toE, "setoption newgame\n"); } else // optional in UCCI\r
            fprintf(toE, "u%cinewgame\n", sc); fflush(toE);\r
            pause = 1; // wait for option settings to take effect\r
-           fprintf(toE, "isready\n");\r
+           fprintf(toE, "isready\n"); fflush(toE);\r
            Sync(PAUSE); // wait for readyok\r
        }\r
        else if(!strcmp(command, "usermove")) {\r