+#include "thread_win32.h"
+
+
+/// Thread struct keeps together all the thread related stuff. 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 : public std::thread {
+
+ Thread();
+ virtual ~Thread();
+ virtual void search();
+ void idle_loop();
+ void join();
+ void notify_one();
+ void wait(std::atomic_bool& b);
+
+ std::atomic_bool exit, searching, resetCalls;
+ Mutex mutex;
+ ConditionVariable sleepCondition;
+
+ Pawns::Table pawnsTable;
+ Material::Table materialTable;
+ Endgames endgames;
+ size_t idx, PVIdx;
+ int maxPly, callsCnt;
+
+ Position rootPos;
+ Search::RootMoveVector rootMoves;
+ Depth rootDepth;
+ HistoryStats history;
+ MovesStats counterMoves;
+ Depth completedDepth;
+};