]> git.sesse.net Git - stockfish/blobdiff - src/thread.cpp
Fix dependency generation for MacOSX
[stockfish] / src / thread.cpp
index d8740db2a66c39f04e49171cc7991e7d0e75b4f8..71bf08d2da67e238590a93b8c23182f047d4e4a4 100644 (file)
@@ -174,17 +174,16 @@ void Thread::split(Position& pos, Stack* ss, Value alpha, Value beta, Value* bes
   while (    sp.slavesMask.count() < MAX_SLAVES_PER_SPLITPOINT
          && (slave = Threads.available_slave(&sp)) != nullptr)
   {
-     slave->mutex.lock();
+     slave->allocMutex.lock();
 
       if (slave->can_join(activeSplitPoint))
       {
           activeSplitPoint->slavesMask.set(slave->idx);
           slave->activeSplitPoint = activeSplitPoint;
           slave->searching = true;
-          slave->sleepCondition.notify_one(); // Could be sleeping
       }
 
-      slave->mutex.unlock();
+      slave->allocMutex.unlock();
   }
 
   // Everything is set up. The master thread enters the idle loop, from which
@@ -374,5 +373,7 @@ void ThreadPool::start_thinking(const Position& pos, const LimitsType& limits,
           RootMoves.push_back(RootMove(m));
 
   main()->thinking = true;
-  main()->notify_one(); // Starts main thread
+
+  for (Thread* th : *this)
+      th->notify_one();
 }