X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fthread.h;h=a88bb6d311c6e14474ee7d0cc411025866586555;hp=6f231363e7e5de837afe89e67f73c947c58ce192;hb=553655eb073cdd59c726dd77fcf368d499029467;hpb=f01b53c37400e676fdf13d52323bc7bb65502e90 diff --git a/src/thread.h b/src/thread.h index 6f231363..a88bb6d3 100644 --- a/src/thread.h +++ b/src/thread.h @@ -66,6 +66,9 @@ struct SplitPoint { struct Thread { + Thread(int id); + ~Thread(); + void wake_up(); bool cutoff_occurred() const; bool is_available_to(int master) const; @@ -100,7 +103,7 @@ class ThreadsManager { static storage duration are automatically set to zero before enter main() */ public: - Thread& operator[](int threadID) { return threads[threadID]; } + Thread& operator[](int threadID) { return *threads[threadID]; } void init(); void exit(); @@ -123,7 +126,8 @@ public: private: friend struct Thread; - Thread threads[MAX_THREADS + 1]; // Last one is used as a timer + Thread* timer; + Thread* threads[MAX_THREADS]; Lock splitLock; WaitCondition sleepCond; Depth minimumSplitDepth;