X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=ecfaaa569dfac037a0060187be323d355c37b751;hp=b7a242f98470422cfeacd7041cefdd917d3fe7fc;hb=e4d34e18153c953e63c49dc1c9dfd8ccdaa259f0;hpb=42caebfaa5854c28cc2799536bfc56a9b7ba97f3 diff --git a/src/search.cpp b/src/search.cpp index b7a242f9..ecfaaa56 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -325,7 +325,7 @@ namespace { RootMoves[i].prevScore = RootMoves[i].score; // MultiPV loop. We perform a full root search for each PV line - for (PVIdx = 0; PVIdx < PVSize; ++PVIdx) + for (PVIdx = 0; PVIdx < PVSize && !Signals.stop; ++PVIdx) { // Reset aspiration window starting size if (depth >= 5) @@ -354,11 +354,11 @@ namespace { for (size_t i = 0; i <= PVIdx; ++i) RootMoves[i].insert_pv_in_tt(pos); - // If search has been stopped return immediately. Sorting and + // If search has been stopped break immediately. Sorting and // writing PV back to TT is safe becuase RootMoves is still // valid, although refers to previous iteration. if (Signals.stop) - return; + break; // When failing high/low give some update (without cluttering // the UI) before to research. @@ -415,7 +415,7 @@ namespace { Signals.stop = true; // Do we have time for the next iteration? Can we stop searching now? - if (Limits.use_time_management() && !Signals.stopOnPonderhit) + if (Limits.use_time_management() && !Signals.stop && !Signals.stopOnPonderhit) { bool stop = false; // Local variable, not the volatile Signals.stop