source: cheroxy/branches/b0_1_threading/include/CRXThread.h@ 9

Last change on this file since 9 was 9, checked in by cheese, 12 years ago

#1 fix mutex code

File size: 616 bytes
Line 
1/*
2 * CRXThread.h
3 */
4
5#ifdef _WIN32
6# include <windows.h>
7# include <process.h>
8# define CRX_THREAD_TYPE void
9#else
10# include <pthread.h>
11# define CRX_THREAD_TYPE void *
12#endif
13
14typedef CRX_THREAD_TYPE (* CRX_THREAD_CALLBACK) (void *);
15
16class CRXThread
17{
18private:
19 bool mIsRunnable;
20
21 CRX_THREAD_CALLBACK mCallback;
22 void * mThreadArg;
23
24public:
25 CRXThread (void);
26 ~CRXThread (void);
27
28public:
29 void Create (void);
30
31 virtual int Run (void);
32 void Stop (void);
33 inline void SetRunnable (bool aIsRunnable);
34 inline bool IsRunnable (void) const;
35};
36
37
Note: See TracBrowser for help on using the repository browser.