]> git.sesse.net Git - stockfish/blobdiff - src/thread.cpp
Little reformat of elapsed_search_time()
[stockfish] / src / thread.cpp
index e48ea6fd38e6cc22188c5fb20029353f84966309..06646a7b99b131d9751ccdc7b951dd9f6a631bb5 100644 (file)
@@ -428,8 +428,8 @@ void Thread::main_loop() {
 // then function returns immediately, otherwise caller is blocked waiting for
 // the search to finish.
 
-void ThreadsManager::start_thinking(bool asyncMode) {
-
+void ThreadsManager::start_thinking(const Position& pos, const Search::LimitsType& limits,
+                                    const std::vector<Move>& searchMoves, bool asyncMode) {
   Thread& main = threads[0];
 
   lock_grab(&main.sleepLock);
@@ -438,6 +438,11 @@ void ThreadsManager::start_thinking(bool asyncMode) {
   while (!main.do_sleep)
       cond_wait(&sleepCond, &main.sleepLock);
 
+  // Copy input arguments to Search global variables
+  Search::RootPosition.copy(pos, 0);
+  Search::Limits = limits;
+  Search::RootMoves = searchMoves;
+
   // Reset signals before to start the search
   memset((void*)&Search::Signals, 0, sizeof(Search::Signals));