]> git.sesse.net Git - stockfish/blobdiff - src/thread.cpp
Re-apply the fix for Limits::ponder race
[stockfish] / src / thread.cpp
index 66f74b997342c0db87304f29ab5eb1c58983119c..6d3364d5c56525c1bdad9fc8af803ce8ed2234e2 100644 (file)
@@ -35,7 +35,7 @@ ThreadPool Threads; // Global object
 Thread::Thread() {
 
   exit = false;
-  maxPly = 0;
+  selDepth = 0;
   nodes = tbHits = 0;
   idx = Threads.size(); // Start from 0
 
@@ -183,11 +183,12 @@ uint64_t ThreadPool::tb_hits() const {
 /// 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;
 
@@ -210,7 +211,6 @@ void ThreadPool::start_thinking(Position& pos, StateListPtr& states,
 
   for (Thread* th : Threads)
   {
-      th->maxPly = 0;
       th->nodes = 0;
       th->tbHits = 0;
       th->rootDepth = DEPTH_ZERO;