2011-10-03 14:41:19 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
class cThread
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef void (ThreadFunc)(void*);
|
2011-12-23 09:26:29 -05:00
|
|
|
cThread( ThreadFunc a_ThreadFunction, void* a_Param, const char* a_ThreadName = 0 );
|
2011-10-03 14:41:19 -04:00
|
|
|
~cThread();
|
|
|
|
|
|
|
|
void Start( bool a_bWaitOnDelete = true );
|
|
|
|
void WaitForThread();
|
|
|
|
private:
|
|
|
|
ThreadFunc* m_ThreadFunction;
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
static unsigned long MyThread(void* a_Param );
|
|
|
|
#else
|
|
|
|
static void *MyThread( void *lpParam );
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void* m_Param;
|
|
|
|
cEvent* m_Event;
|
|
|
|
cEvent* m_StopEvent;
|
2011-12-23 09:26:29 -05:00
|
|
|
|
|
|
|
char* m_ThreadName;
|
2011-10-03 14:41:19 -04:00
|
|
|
};
|