- void init(); // No c'tor and d'tor, threads rely on globals that should be
- void exit(); // initialized and are valid during the whole thread lifetime.
+ void init(size_t); // No constructor and destructor, threads rely on globals that should
+ void exit(); // be initialized and valid during the whole thread lifetime.
+ void start_thinking(Position&, StateListPtr&, const Search::LimitsType&, bool = false);
+ void set(size_t);
+
+ MainThread* main() const { return static_cast<MainThread*>(front()); }
+ uint64_t nodes_searched() const { return accumulate(&Thread::nodes); }
+ uint64_t tb_hits() const { return accumulate(&Thread::tbHits); }
+
+ std::atomic_bool stop, ponder, stopOnPonderhit;
+
+private:
+ StateListPtr setupStates;
+
+ uint64_t accumulate(std::atomic<uint64_t> Thread::* member) const {