X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=1e9c5010c97df7c56f2221b6b96081bdd49dc466;hp=4a0302e51f9e7087d72892bdc23e84339ddef191;hb=93195555ed230df1d29933de6236d6847ae88310;hpb=07e0741dfbca07097f38e46f3f7752b48675a515 diff --git a/src/search.cpp b/src/search.cpp index 4a0302e5..1e9c5010 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -290,12 +290,11 @@ void MainThread::search() { { th->maxPly = 0; th->rootDepth = DEPTH_ZERO; - th->searching = true; if (th != this) { th->rootPos = Position(rootPos, th); th->rootMoves = rootMoves; - th->notify_one(); // Wake up the thread and start searching + th->start_searching(); } } @@ -324,7 +323,7 @@ void MainThread::search() { // Wait until all threads have finished for (Thread* th : Threads) if (th != this) - th->join(); + th->wait_for_search_finished(); // Check if there are threads with a better score than main thread. Thread* bestThread = this;