1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00:00

Avoid wake up master thread when useless

Check we are the last slave of the split point
before to wake up the master. This should avoid
spurious wakes up.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2012-08-19 13:06:26 +01:00
parent dba1bc354a
commit 2f4a9a140a

View file

@ -1728,8 +1728,11 @@ void Thread::idle_loop() {
// case we are the last slave of the split point. // case we are the last slave of the split point.
if ( Threads.use_sleeping_threads() if ( Threads.use_sleeping_threads()
&& this != sp->master && this != sp->master
&& !sp->master->is_searching) && !sp->slavesMask)
{
assert(!sp->master->is_searching);
sp->master->wake_up(); sp->master->wake_up();
}
// After releasing the lock we cannot access anymore any SplitPoint // After releasing the lock we cannot access anymore any SplitPoint
// related data in a safe way becuase it could have been released under // related data in a safe way becuase it could have been released under