}
-/// Thread::wait() waits on sleep condition until condition is true
-
-void Thread::wait(std::atomic_bool& condition) {
-
- std::unique_lock<Mutex> lk(mutex);
- sleepCondition.wait(lk, [&]{ return bool(condition); });
-}
-
-
/// Thread::start_searching() wakes up the thread that will start the search
-void Thread::start_searching(bool resume) {
+void Thread::start_searching() {
std::unique_lock<Mutex> lk(mutex);
-
- if (!resume)
- searching = true;
-
+ searching = true;
sleepCondition.notify_one();
}
/// and starts a new search, then returns immediately.
void ThreadPool::start_thinking(Position& pos, StateListPtr& states,
- const Search::LimitsType& limits) {
+ const Search::LimitsType& limits, bool ponderMode) {
main()->wait_for_search_finished();
stopOnPonderhit = stop = false;
+ ponder = ponderMode;
Search::Limits = limits;
Search::RootMoves rootMoves;