X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=b08b687af2408f55d3690645963ae899db907fdd;hp=08a779565289767d1fa56b63e03671d77ac970fe;hb=2e8552db76092a7e4fa8f7278231d66e26a756d9;hpb=a4b2eeea759f10ca1ce864c2a30a990a9a991aa9 diff --git a/src/search.cpp b/src/search.cpp index 08a77956..b08b687a 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1599,7 +1599,7 @@ void Thread::idle_loop() { && !(this_sp && this_sp->slavesMask.none()) && !searching) { - if ( !this_sp + if ( !this_sp && !Threads.main()->thinking) { std::unique_lock lk(mutex); @@ -1613,12 +1613,12 @@ void Thread::idle_loop() { // If this thread has been assigned work, launch a search while (searching) { - mutex.lock(); + spinlock.acquire(); assert(activeSplitPoint); SplitPoint* sp = activeSplitPoint; - mutex.unlock(); + spinlock.release(); Stack stack[MAX_PLY+4], *ss = stack+2; // To allow referencing (ss-2) and (ss+2) Position pos(*sp->pos, this);