X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fthread.cpp;h=8d522fa2bed9638b8375a859a18e9705ce1b45b6;hp=541610a1ca4b2bd5a63d16323c4d2aed991aae21;hb=5900ab76a05b96f902fd3fc2794670916a7cb0ea;hpb=3df2c01b5769c7ae996fb5b992c06e4a5428ad35 diff --git a/src/thread.cpp b/src/thread.cpp index 541610a1..8d522fa2 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -196,9 +196,9 @@ void ThreadPool::init() { } -// d'tor cleanly terminates the threads when the program exits. +// exit() cleanly terminates the threads before the program exits. -ThreadPool::~ThreadPool() { +void ThreadPool::exit() { for (size_t i = 0; i < threads.size(); i++) delete threads[i]; @@ -417,7 +417,7 @@ void ThreadPool::start_searching(const Position& pos, const LimitsType& limits, const std::vector& searchMoves, StateStackPtr& states) { wait_for_search_finished(); - SearchTime.restart(); // As early as possible + SearchTime = Time::now(); // As early as possible Signals.stopOnPonderhit = Signals.firstRootMove = false; Signals.stop = Signals.failedLowAtRoot = false;