]> git.sesse.net Git - stockfish/blobdiff - src/thread.h
Allow a slave to 'late join' another splitpoint
[stockfish] / src / thread.h
index 44aa68835f892a56113f58de9a2a4f1d6ba6d2bd..edc4ee31833d38a0779f39233a8db280e9983ab4 100644 (file)
@@ -77,6 +77,7 @@ struct SplitPoint {
   // Shared data
   Mutex mutex;
   std::bitset<MAX_THREADS> slavesMask;
+  volatile bool allowLatejoin;
   volatile uint64_t nodes;
   volatile Value alpha;
   volatile Value bestValue;
@@ -113,8 +114,9 @@ struct Thread : public ThreadBase {
 
   Thread();
   virtual void idle_loop();
+  bool attempt_to_latejoin();
   bool cutoff_occurred() const;
-  bool available_to(const Thread* master) const;
+  bool available_to(const Thread* master, bool latejoin) const;
 
   template <bool Fake>
   void split(Position& pos, const Search::Stack* ss, Value alpha, Value beta, Value* bestValue, Move* bestMove,