+// ThreadState type is used to represent thread's current state
+
+enum ThreadState
+{
+ THREAD_INITIALIZING, // thread is initializing itself
+ THREAD_SEARCHING, // thread is performing work
+ THREAD_AVAILABLE, // thread is waiting for work
+ THREAD_BOOKED, // other thread (master) has booked us as a slave
+ THREAD_WORKISWAITING, // master has ordered us to start
+ THREAD_TERMINATED // we are quitting and thread is terminated
+};