D:/Zythum/DinoKod/Common/Thread.h

00001 //---------------------------------------------------------------------------------------------
00002 //      This file is a part of "DinoKod".
00003 //      Copyright © 2003 Dino Productions. All Rights Reserved.
00004 //      
00005 //      File                    : Thread.h
00006 //      Author                  : Sebastien LEIX        sebastien.leix@wanadoo.fr
00007 //      Date                    : 17/05/2003
00008 //      Modification    :
00009 //
00010 //---------------------------------------------------------------------------------------------
00011 #ifndef __THREAD_H__
00012 #define __THREAD_H__
00013 
00014 #include "Common/CommonDll.h"
00015 #include "Common/Types.h"
00016 #include <windows.h>
00017 
00018 //---------------------------------------------------------------------------------------------
00019 typedef enum _KTHREADPRIORITY
00020 {
00021         KCTP_ABOVE_NORMAL,
00022         KCTP_BELOW_NORMAL,
00023         KCTP_HIGHEST,
00024         KCTP_IDLE,
00025         KCTP_LOWEST,
00026         KCTP_NORMAL,
00027         KCTP_TIME_CRITICAL
00028 } KTHREADPRIORITY;
00029 
00030 //---------------------------------------------------------------------------------------------
00031 class COMMON_API KThread
00032 {
00033 private:
00034         static DWORD WINAPI     StaticThreadProc( LPVOID lpParam );
00035 
00036 protected:
00037         HANDLE                          m_hThread;
00038         HANDLE                          m_hStopEvent;
00039 
00040         virtual u32                     ThreadProc()=0;
00041 
00042 public:
00043 
00044         KThread();
00045 
00046         bool                            StartThread();
00047         bool                            StopThread();
00048         bool                            IsThreadRunning();
00049         void                            SetPriority( KTHREADPRIORITY Priority );
00050 };
00051 
00052 #endif  __THREAD_H__

Generated on Sun Mar 25 20:02:11 2007 for Zythum Project by  doxygen 1.5.1-p1