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 |
|
---|
14 | typedef CRX_THREAD_TYPE (* CRX_THREAD_CALLBACK) (void *);
|
---|
15 |
|
---|
16 | class CRXThread
|
---|
17 | {
|
---|
18 | private:
|
---|
19 | bool mIsRunnable;
|
---|
20 |
|
---|
21 | CRX_THREAD_CALLBACK mCallback;
|
---|
22 | void * mThreadArg;
|
---|
23 |
|
---|
24 | public:
|
---|
25 | CRXThread (void);
|
---|
26 | ~CRXThread (void);
|
---|
27 |
|
---|
28 | public:
|
---|
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.