Remove an incorrect assert in wake_sleeping_threads()
authorMarco Costalba <mcostalba@gmail.com>
Sat, 27 Feb 2010 11:01:07 +0000 (12:01 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 27 Feb 2010 11:01:07 +0000 (12:01 +0100)
Currently there is no guarantee that threads are sleeping
when calling wake_sleeping_threads() because put_threads_to_sleep()
returns without waiting for threads to actually sleep.

Assert can be easily triggered calling put_threads_to_sleep() and
wake_sleeping_threads() in a tight loop.

No functional change.

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

index 2351dd17fbb87043fdd88b1888ea7fba3ad11d16..4fd1c03d0a8830ba5411e991a13481e3336a61e5 100644 (file)
@@ -2999,9 +2999,6 @@ namespace {
     if (ActiveThreads == 1)
         return;
 
-    for (int i = 1; i < ActiveThreads; i++)
-        assert(threads[i].state == THREAD_SLEEPING);
-
 #if !defined(_MSC_VER)
     pthread_mutex_lock(&WaitLock);
     pthread_cond_broadcast(&WaitCond);