Search::LimitsType limits;
string token;
+ limits.startTime = now(); // As early as possible!
+
while (is >> token)
if (token == "searchmoves")
while (is >> token)
|| (token == "ponderhit" && Search::Signals.stopOnPonderhit))
{
Search::Signals.stop = true;
- Threads.main()->notify_one(); // Could be sleeping
+ Threads.main()->start_searching(true); // Could be sleeping
}
else if (token == "ponderhit")
Search::Limits.ponder = 0; // Switch to normal search
else if (token == "ucinewgame")
{
- Search::reset();
+ Search::clear();
Time.availableNodes = 0;
}
else if (token == "isready") sync_cout << "readyok" << sync_endl;
} while (token != "quit" && argc == 1); // Passed args have one-shot behaviour
- Threads.main()->join(); // Cannot quit whilst the search is running
+ Threads.main()->wait_for_search_finished();
}