mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 11:39:15 +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:
parent
dba1bc354a
commit
2f4a9a140a
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue