]> git.sesse.net Git - stockfish/commitdiff
Do not wait for sleeping in init_threads()
authorMarco Costalba <mcostalba@gmail.com>
Sat, 27 Feb 2010 12:26:04 +0000 (13:26 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 27 Feb 2010 12:26:04 +0000 (13:26 +0100)
We can't do it with full guarantee anyway because
there is always a possible race between the setting of
state to THREAD_SLEEPING and actual sleeping.

So just remove the not perfect code to avoid misunderstandings.
This reflects what we have done in wake_sleeping_threads() in
the previous patch.

No functional change.

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

index 4fd1c03d0a8830ba5411e991a13481e3336a61e5..13f333d9fc5a95511f133ee15f5d0a681e095f16 100644 (file)
@@ -2768,9 +2768,6 @@ namespace {
             cout << "Failed to create thread number " << i << endl;
             Application::exit_with_failure();
         }
-
-        // Wait until the thread has finished launching and is gone to sleep
-        while (threads[i].state != THREAD_SLEEPING);
     }
   }