]> git.sesse.net Git - stockfish/blobdiff - src/thread.cpp
Big Position renaming
[stockfish] / src / thread.cpp
index 6fefd58a792b9225d7a121bf102e38e18a8850fc..4ae268eb77b9ae885554bf4e60c78ef1e2ebf032 100644 (file)
@@ -309,7 +309,7 @@ Value ThreadsManager::split(Position& pos, Stack* ss, Value alpha, Value beta,
   assert(beta <= VALUE_INFINITE);
   assert(depth > DEPTH_ZERO);
 
-  int master = pos.thread();
+  int master = pos.this_thread();
   Thread& masterThread = *threads[master];
 
   if (masterThread.splitPointsCnt >= MAX_SPLITPOINTS_PER_THREAD)
@@ -429,9 +429,11 @@ void ThreadsManager::wait_for_search_finished() {
 // main_loop() so to start a new search, then returns immediately.
 
 void ThreadsManager::start_searching(const Position& pos, const LimitsType& limits,
-                                     const std::set<Move>& searchMoves) {
+                                     const std::vector<Move>& searchMoves) {
   wait_for_search_finished();
 
+  SearchTime.restart(); // As early as possible
+
   Signals.stopOnPonderhit = Signals.firstRootMove = false;
   Signals.stop = Signals.failedLowAtRoot = false;
 
@@ -440,7 +442,7 @@ void ThreadsManager::start_searching(const Position& pos, const LimitsType& limi
   RootMoves.clear();
 
   for (MoveList<MV_LEGAL> ml(pos); !ml.end(); ++ml)
-      if (searchMoves.empty() || searchMoves.count(ml.move()))
+      if (searchMoves.empty() || count(searchMoves.begin(), searchMoves.end(), ml.move()))
           RootMoves.push_back(RootMove(ml.move()));
 
   threads[0]->do_sleep = false;