]> git.sesse.net Git - stockfish/blobdiff - src/uci.cpp
Teach 'bench' to run current position
[stockfish] / src / uci.cpp
index c6da2fc4851acee54e5b60f140cb054d3066e5f5..96aae854311245558d678b163ce25107ccce6aa9 100644 (file)
@@ -59,6 +59,8 @@ void uci_loop(const string& args) {
   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
           }
       }