X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fthread.h;h=4b712076083b701ee23183e9a352d0ecfc2b6da6;hb=c483ffc773c012b49f4ea2f5bd1d788c1f0dc4ac;hp=6744ef310b06617a5ee6d5b3308efa3d3b7a9524;hpb=41561c9bb80a176f9fce169975fcb553340499fc;p=stockfish diff --git a/src/thread.h b/src/thread.h index 6744ef31..4b712076 100644 --- a/src/thread.h +++ b/src/thread.h @@ -70,14 +70,17 @@ class Thread { Thread(const Thread&); // Only declared to disable the default ones Thread& operator=(const Thread&); // that are not suitable in this case. + typedef void (Thread::* Fn) (); + public: - Thread(int id); + Thread(Fn fn); ~Thread(); void wake_up(); bool cutoff_occurred() const; bool is_available_to(int master) const; void idle_loop(SplitPoint* sp_master); + void idle_loop() { idle_loop(NULL); } // Hack to allow storing in start_fn void main_loop(); void timer_loop(); void wait_for_stop_or_ponderhit(); @@ -89,7 +92,8 @@ public: int maxPly; Lock sleepLock; WaitCondition sleepCond; - ThreadHandle handle; + NativeHandle handle; + Fn start_fn; SplitPoint* volatile curSplitPoint; volatile int splitPointsCnt; volatile bool is_searching;