- Thread* main = threads[0];
- lock_grab(main->sleepLock);
- while (!main->do_sleep) cond_wait(sleepCond, main->sleepLock);
- lock_release(main->sleepLock);
-}
-
-
-// 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.
-
-void ThreadsManager::start_searching(const Position& pos, const LimitsType& limits,
- const std::set<Move>& searchMoves, bool async) {
- wait_for_search_finished();