]> git.sesse.net Git - stockfish/blobdiff - src/uci.cpp
Teach 'bench' to run current position
[stockfish] / src / uci.cpp
index 4c3faf05c02c07999017594728c1249213dd4b2d..96aae854311245558d678b163ce25107ccce6aa9 100644 (file)
@@ -56,9 +56,11 @@ namespace {
 
 void uci_loop(const string& args) {
 
-  Position pos(StartFEN, false, 0); // The root position
+  Position pos(StartFEN, false, Threads.main_thread()); // The root position
   string cmd, token;
 
+  Search::RootPosition = pos;
+
   while (token != "quit")
   {
       if (!args.empty())
@@ -87,7 +89,7 @@ void uci_loop(const string& args) {
           if (Search::Signals.stopOnPonderhit)
           {
               Search::Signals.stop = true;
-              Threads.wait_for_search_finished(); // Wake up if is sleeping
+              Threads.main_thread()->wake_up(); // Could be sleeping
           }
       }
 
@@ -167,7 +169,7 @@ namespace {
     else
         return;
 
-    pos.from_fen(fen, Options["UCI_Chess960"]);
+    pos.from_fen(fen, Options["UCI_Chess960"], Threads.main_thread());
 
     // Parse move list (if any)
     while (is >> token && (m = move_from_uci(pos, token)) != MOVE_NONE)