X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fthread.cpp;h=10f432bd71bdf81b30af7eafdf7ff2606d046cc9;hp=65d01d9100a874e19db9addea3772bafa735dd69;hb=4124c94583c8f618738e4e357d86bc8579a5cde5;hpb=3aa471f2a9cb1cccd37c27906dd386b9724e32ab diff --git a/src/thread.cpp b/src/thread.cpp index 65d01d91..10f432bd 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -424,13 +424,11 @@ void ThreadsManager::wait_for_search_finished() { } -// ThreadsManager::start_searching() is used by UI thread to wake up the main -// thread parked in main_loop() and starting a new search. If async is true -// then function returns immediately, otherwise caller is blocked waiting for -// the search to finish. +// ThreadsManager::start_searching() wakes up the main thread sleeping in +// main_loop() so to start a new search, then returns immediately. void ThreadsManager::start_searching(const Position& pos, const LimitsType& limits, - const std::set& searchMoves, bool async) { + const std::set& searchMoves) { wait_for_search_finished(); Signals.stopOnPonderhit = Signals.firstRootMove = false; @@ -444,8 +442,5 @@ 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]->wake_up(); // Start main thread - - if (!async) - wait_for_search_finished(); + threads[0]->wake_up(); }