X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fthread.cpp;h=007ed46e10c54bb85e12955f835b3ba6c8d79ede;hp=d8740db2a66c39f04e49171cc7991e7d0e75b4f8;hb=e5da0e4b79b405da5bdc42f6fb4c2ba49afba00a;hpb=81c7975dcdf37ec96d308f800c2a40f6cb08907e diff --git a/src/thread.cpp b/src/thread.cpp index d8740db2..007ed46e 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -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