]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Add one assert
[stockfish] / src / search.cpp
index 775ad3effeddd7275f3f1769fa3bf350d8dcb412..3a70c8f797fde7e299f9fa39d020dd9352d91d73 100644 (file)
@@ -2594,6 +2594,7 @@ namespace {
         // instead of wasting CPU time polling for work.
         while (AllThreadsShouldSleep || threadID >= ActiveThreads)
         {
+            assert(!waitSp);
             assert(threadID != 0);
             threads[threadID].state = THREAD_SLEEPING;
 
@@ -2960,12 +2961,9 @@ namespace {
     // This makes the threads to go to sleep
     AllThreadsShouldSleep = true;
 
-    // Wait for the threads to be all sleeping and reset flags
-    // to a known state.
+    // Reset flags to a known state.
     for (int i = 1; i < ActiveThreads; i++)
     {
-        while (threads[i].state != THREAD_SLEEPING);
-
         // This flag can be in a random state
         threads[i].printCurrentLineRequest = false;
     }