From 2f4a9a140ae7882365f64ac11cf263bd505418e6 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 19 Aug 2012 13:06:26 +0100 Subject: [PATCH] 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 --- src/search.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/search.cpp b/src/search.cpp index 043ada63..a29fd0f6 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1728,8 +1728,11 @@ void Thread::idle_loop() { // case we are the last slave of the split point. if ( Threads.use_sleeping_threads() && this != sp->master - && !sp->master->is_searching) + && !sp->slavesMask) + { + assert(!sp->master->is_searching); sp->master->wake_up(); + } // After releasing the lock we cannot access anymore any SplitPoint // related data in a safe way becuase it could have been released under -- 2.39.2