X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fthread.h;h=92f5ed33a168b9742c176055759b01cb78c2c6e7;hp=7557c0e7a90a80695dc37ae10aae4d2d8b08867a;hb=a3a0df92a3ed5ce7c98ff596e687d3d6533590c8;hpb=55948623e7b8ad1fc6624cd06733b16d295eecb8 diff --git a/src/thread.h b/src/thread.h index 7557c0e7..92f5ed33 100644 --- a/src/thread.h +++ b/src/thread.h @@ -114,10 +114,10 @@ struct Thread : public ThreadBase { Thread(); virtual void idle_loop(); bool cutoff_occurred() const; - bool is_available_to(Thread* master) const; + bool available_to(const Thread* master) const; template - void split(Position& pos, Search::Stack* ss, Value alpha, Value beta, Value* bestValue, Move* bestMove, + void split(Position& pos, const Search::Stack* ss, Value alpha, Value beta, Value* bestValue, Move* bestMove, Depth depth, Move threatMove, int moveCount, MovePicker* movePicker, int nodeType, bool cutNode); SplitPoint splitPoints[MAX_SPLITPOINTS_PER_THREAD]; @@ -143,9 +143,10 @@ struct MainThread : public Thread { }; struct TimerThread : public ThreadBase { - TimerThread() : msec(0) {} + TimerThread() : run(false) {} virtual void idle_loop(); - int msec; + bool run; + static const int Resolution = 5; // msec between two check_time() calls }; @@ -160,7 +161,7 @@ struct ThreadPool : public std::vector { MainThread* main() { return static_cast((*this)[0]); } void read_uci_options(); - Thread* available_slave(Thread* master) const; + Thread* available_slave(const Thread* master) const; void wait_for_think_finished(); void start_thinking(const Position&, const Search::LimitsType&, const std::vector&, Search::StateStackPtr&);