]> git.sesse.net Git - stockfish/blobdiff - src/thread.h
Introduce and use wait_for_search_finished()
[stockfish] / src / thread.h
index 4b712076083b701ee23183e9a352d0ecfc2b6da6..e6a4cf95744ca0260f2ae11fd7c58aa7a1dae169 100644 (file)
@@ -47,7 +47,6 @@ struct SplitPoint {
   MovePicker* mp;
   SplitPoint* parent;
 
-
   // Shared data
   Lock lock;
   volatile uint64_t slavesMask;
@@ -112,22 +111,22 @@ class ThreadsManager {
      static storage duration are automatically set to zero before enter main()
   */
 public:
-  void init();
-  void exit();
+  void init(); // No c'tor becuase Threads is static and we need stuff initialized
+  ~ThreadsManager();
 
   Thread& operator[](int id) { return *threads[id]; }
   bool use_sleeping_threads() const { return useSleepingThreads; }
   int min_split_depth() const { return minimumSplitDepth; }
   int size() const { return (int)threads.size(); }
 
-  void wake_up();
-  void sleep();
+  void wake_up() const;
+  void sleep() const;
   void read_uci_options();
   bool available_slave_exists(int master) const;
   void set_timer(int msec);
-  void stop_thinking();
-  void start_thinking(const Position& pos, const Search::LimitsType& limits,
-                      const std::set<Move>& = std::set<Move>(), bool async = false);
+  void wait_for_search_finished();
+  void start_searching(const Position& pos, const Search::LimitsType& limits,
+                       const std::set<Move>& = std::set<Move>(), bool async = false);
 
   template <bool Fake>
   Value split(Position& pos, Search::Stack* ss, Value alpha, Value beta, Value bestValue, Move* bestMove,