X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fthread.cpp;h=6a5454faa9ed5abc0dc07a06ab585cb7b5f0bea8;hp=10f432bd71bdf81b30af7eafdf7ff2606d046cc9;hb=22e294e044ef60d40b94f24393d3dd18bc0bff71;hpb=4124c94583c8f618738e4e357d86bc8579a5cde5 diff --git a/src/thread.cpp b/src/thread.cpp index 10f432bd..6a5454fa 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -137,7 +137,6 @@ void Thread::main_loop() { void Thread::wake_up() { lock_grab(sleepLock); - do_sleep = false; cond_signal(sleepCond); lock_release(sleepLock); } @@ -257,6 +256,7 @@ void ThreadsManager::wake_up() const { for (int i = 0; i < size(); i++) { threads[i]->maxPly = 0; + threads[i]->do_sleep = false; if (!useSleepingThreads) threads[i]->wake_up(); @@ -442,5 +442,6 @@ void ThreadsManager::start_searching(const Position& pos, const LimitsType& limi if (searchMoves.empty() || searchMoves.count(ml.move())) RootMoves.push_back(RootMove(ml.move())); + threads[0]->do_sleep = false; threads[0]->wake_up(); }