]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Refactor ThreadsManager::set_size() functionality
[stockfish] / src / search.cpp
index 8d1b43b0f0ff1ac74cb832e72a281fdda1bf9792..cc82af7dbf1a88959316b2c8dd3c025f6cf78227 100644 (file)
@@ -298,7 +298,7 @@ void Search::think() {
           << endl;
   }
 
-  Threads.set_size(Options["Threads"]);
+  Threads.wake_up();
 
   // Set best timer interval to avoid lagging under time pressure. Timer is
   // used to check for remaining available thinking time.
@@ -312,7 +312,7 @@ void Search::think() {
 
   // Stop timer and send all the slaves to sleep, if not already sleeping
   Threads.set_timer(0);
-  Threads.set_size(1);
+  Threads.sleep();
 
   if (Options["Use Search Log"])
   {
@@ -564,6 +564,7 @@ namespace {
     {
         tte = NULL;
         ttMove = excludedMove = MOVE_NONE;
+        ttValue = VALUE_ZERO;
         sp = ss->sp;
         bestMove = sp->bestMove;
         threatMove = sp->threatMove;