]> git.sesse.net Git - stockfish/blobdiff - src/thread.cpp
Reformat all_slaves_finished()
[stockfish] / src / thread.cpp
index df76dcca7a2e1fe990c4859bd23219afcc8188f8..ca9fe14d8fa48dfee160df9e454fbfadb2013f53 100644 (file)
@@ -239,6 +239,19 @@ bool ThreadsManager::available_slave_exists(int master) const {
 }
 
 
+// split_point_finished() checks if all the slave threads of a given split
+// point have finished searching.
+
+bool ThreadsManager::split_point_finished(SplitPoint* sp) const {
+
+  for (int i = 0; i < activeThreads; i++)
+      if (sp->is_slave[i])
+          return false;
+
+  return true;
+}
+
+
 // split() does the actual work of distributing the work at a node between
 // several available threads. If it does not succeed in splitting the
 // node (because no idle threads are available, or because we have no unused