]> git.sesse.net Git - stockfish/blobdiff - src/thread.cpp
Link with -static in mingw
[stockfish] / src / thread.cpp
index d8740db2a66c39f04e49171cc7991e7d0e75b4f8..007ed46e10c54bb85e12955f835b3ba6c8d79ede 100644 (file)
@@ -174,17 +174,18 @@ 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();
+
+      slave->notify_one(); // Could be sleeping
   }
 
   // Everything is set up. The master thread enters the idle loop, from which