]> git.sesse.net Git - stockfish/commitdiff
Add a couple of asserts to late join
authorMarco Costalba <mcostalba@gmail.com>
Thu, 19 Feb 2015 09:08:29 +0000 (10:08 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 19 Feb 2015 09:08:29 +0000 (10:08 +0100)
Document and clarify that we cannot rejoin on ourselves
and that we never late join if we are master and all
slaves have finished, inded in this case we exit idle_loop.

No functional change.

src/search.cpp

index 1062c9203a7bbc0c31c0b134e1d1f882d95f4a76..b1eac341f62dfb5d61998b1f1fb768577c0aafc8 100644 (file)
@@ -1602,6 +1602,9 @@ void Thread::idle_loop() {
                   && sp->slavesCount < MAX_SLAVES_PER_SPLITPOINT
                   && available_to(Threads[i]))
               {
+                  assert(this != Threads[i]);
+                  assert(!(this_sp && this_sp->slavesMask.none()));
+
                   // Compute the recursive split points chain size
                   int level = -1;
                   for (SplitPoint* spp = Threads[i]->activeSplitPoint; spp; spp = spp->parentSplitPoint)