]> git.sesse.net Git - stockfish/commitdiff
Do not wait for threads falling asleep
authorJoona Kiiski <joona.kiiski@gmail.com>
Tue, 23 Feb 2010 10:05:26 +0000 (12:05 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 24 Feb 2010 06:27:45 +0000 (07:27 +0100)
I cannot see any reason to do this. Even this is not enough to fix
theoretical race case on Windows which doesn't seem to cause any
problems in practice anyhow

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 775ad3effeddd7275f3f1769fa3bf350d8dcb412..2e3f9d5663718ad4cac483c1d46b630cc5888d36 100644 (file)
@@ -2960,12 +2960,9 @@ namespace {
     // This makes the threads to go to sleep
     AllThreadsShouldSleep = true;
 
     // 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++)
     {
     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;
     }
         // This flag can be in a random state
         threads[i].printCurrentLineRequest = false;
     }