]> git.sesse.net Git - stockfish/commitdiff
Improved cutoff check when reparenting
authorMarco Costalba <mcostalba@gmail.com>
Mon, 16 Apr 2012 12:19:22 +0000 (14:19 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 16 Apr 2012 17:28:08 +0000 (18:28 +0100)
Check for a cutoff occurred also high in
the tree and not only at current split
point.

This avoids some more wasted reparenting.

No functional chnage.

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

index 08a157c2c793235c7977063ad29bc5118cd19e40..61ac9a6a0b854886dcd8cd1fbe03240def54f2ee 100644 (file)
@@ -1871,7 +1871,7 @@ void Thread::idle_loop(SplitPoint* sp_master) {
               // where we are available as a possible slave.
               if (    this->is_available_to(th)
                   &&  spCnt > 0
-                  && !latest->cutoff
+                  && !th->cutoff_occurred()
                   &&  latest->slavesMask == latest->allSlavesMask
                   &&  more_than_one(latest->allSlavesMask))
               {
@@ -1882,7 +1882,7 @@ void Thread::idle_loop(SplitPoint* sp_master) {
                   // of a race storm here !
                   if (    this->is_available_to(th)
                       &&  spCnt == th->splitPointsCnt
-                      && !latest->cutoff
+                      && !th->cutoff_occurred()
                       &&  latest->slavesMask == latest->allSlavesMask
                       &&  more_than_one(latest->allSlavesMask))
                   {