- Mutex mutex;
- ConditionVariable sleepCondition;
- NativeHandle handle;
- Fn start_fn;
- SplitPoint* volatile curSplitPoint;
- volatile int splitPointsCnt;
- volatile bool is_searching;
- volatile bool do_sleep;
- volatile bool do_exit;
+ SplitPoint* volatile activeSplitPoint;
+ volatile int splitPointsSize;
+ volatile bool searching;
+};
+
+
+/// MainThread and TimerThread are derived classes used to characterize the two
+/// special threads: the main one and the recurring timer.
+
+struct MainThread : public Thread {
+ MainThread() : thinking(true) {} // Avoid a race with start_thinking()
+ virtual void idle_loop();
+ volatile bool thinking;
+};
+
+struct TimerThread : public ThreadBase {
+ TimerThread() : msec(0) {}
+ virtual void idle_loop();
+ int msec;