+ wxThreadInternal() { m_state = STATE_NEW; }
+ ~wxThreadInternal() {}
+
+ // thread entry function
+ static void *PthreadStart(void *ptr);
+
+ // start the thread
+ wxThreadError Run();
+
+ // accessors
+ // priority
+ int GetPriority() const { return m_prio; }
+ void SetPriority(int prio) { m_prio = prio; }
+ // state
+ thread_state GetState() const { return m_state; }
+ void SetState(thread_state state) { m_state = state; }
+ // id
+ pthread_t GetId() const { return thread_id; }
+ // "cancelled" flag
+ void Cancel();
+ bool WasCancelled() const { return m_cancelled; }
+
+//private: -- should be!
+ pthread_t thread_id;
+
+private:
+ thread_state m_state; // see thread_state enum
+ int m_prio; // in wxWindows units: from 0 to 100
+
+ // set when the thread should terminate
+ bool m_cancelled;
+
+ // we start running when this condition becomes true
+ wxMutex m_mutexRun;
+ wxCondition m_condRun;
+
+ // this condition becomes true when we get back to PthreadStart() function
+ wxMutex m_mutexStop;
+ wxCondition m_condStop;