Thread.h
author sl
Mon, 17 Mar 2014 12:38:39 +0100
changeset 3 d5f6b2119a13
permissions -rw-r--r--
Fixing init result issue.
     1 //------------------------------------------------------------------------------
     2 #ifndef THREAD_H_INCLUDED
     3 #define THREAD_H_INCLUDED
     4 //------------------------------------------------------------------------------
     5 #include <windows.h>
     6 //------------------------------------------------------------------------------
     7 class Thread
     8 {
     9 protected:
    10   Thread();
    11   virtual ~Thread();
    12 
    13 private:
    14   Thread(const Thread& other) {}
    15   Thread& operator=(const Thread& other) { *this; }
    16 
    17 public:
    18   void Start();
    19   virtual void Interrupt() = 0;
    20   void Join() const;  
    21 
    22 protected:
    23   virtual void Run() = 0;
    24 
    25 private:
    26   static DWORD WINAPI ThreadProc(LPVOID lpParam);
    27 
    28 private:
    29   HANDLE m_hThread;
    30   DWORD m_dwThreadId;
    31 };
    32 //------------------------------------------------------------------------------
    33 #endif
    34 //------------------------------------------------------------------------------