]> git.sesse.net Git - stockfish/blobdiff - src/benchmark.cpp
Fix some races and clarify the code
[stockfish] / src / benchmark.cpp
index 21c6ec1123fb43fe4a648d0ccc411e4842d8ed7c..f61b5da31bef9783f39a9830ce72f7612b1686c1 100644 (file)
@@ -109,9 +109,9 @@ void benchmark(const Position& current, istream& is) {
   string fenFile   = (is >> token) ? token : "default";
   string limitType = (is >> token) ? token : "depth";
 
-  Options["Hash"]    = ttSize;
+  Search::clear(); // Wait for search finished
   Options["Threads"] = threads;
-  Search::clear();
+  Options["Hash"]    = ttSize;
 
   if (limitType == "time")
       limits.movetime = stoi(limit); // movetime is in millisecs