X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fthread.cpp;h=06244dc9bb957c41f5d47d13ed64aa59a40c6bf8;hp=432d573d42ce2b2746a1f11cac6610979d8097ba;hb=f89a8f0769d3c61edf0993721b03058a0c463bda;hpb=aab5863dd42da0a8e493a2ffaca96319b3d19ebb diff --git a/src/thread.cpp b/src/thread.cpp index 432d573d..06244dc9 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -194,7 +194,8 @@ void ThreadPool::init() { } -// exit() cleanly terminates the threads before the program exits +// exit() cleanly terminates the threads before the program exits. Cannot be done in +// d'tor because we have to terminate the threads before to free ThreadPool object. void ThreadPool::exit() { @@ -292,6 +293,7 @@ void Thread::split(Position& pos, const Stack* ss, Value alpha, Value beta, Valu Threads.mutex.lock(); sp.mutex.lock(); + sp.allSlavesSearching = true; // Must be set under lock protection ++splitPointsSize; activeSplitPoint = &sp; activePosition = NULL;