-/// Thread struct keeps together all the thread related stuff like locks, state
-/// and especially split points. We also use per-thread pawn and material hash
-/// tables so that once we get a pointer to an entry its life time is unlimited
-/// and we don't have to care about someone changing the entry under our feet.
-
-struct Thread {
-
- void wake_up();
- bool cutoff_occurred() const;
- bool is_available_to(int master) const;
- void idle_loop(SplitPoint* sp);
- void main_loop();
- void timer_loop();
-
- SplitPoint splitPoints[MAX_ACTIVE_SPLIT_POINTS];
- MaterialInfoTable materialTable;
- PawnInfoTable pawnTable;
- int threadID;
- int maxPly;
- Lock sleepLock;
- WaitCondition sleepCond;
- ThreadHandle handle;
- SplitPoint* volatile splitPoint;
- volatile int activeSplitPoints;
- volatile bool is_searching;
- volatile bool do_sleep;
- volatile bool do_terminate;
+/// MainThread is a derived class with a specific overload for the main thread
+
+struct MainThread : public Thread {
+ virtual void search();
+
+ bool easyMovePlayed, failedLow;
+ double bestMoveChanges;
+ Value previousScore;