| Line | |
|---|
| 1 | #ifndef MSGQUEUE_H
|
|---|
| 2 | #define MSGQUEUE_H
|
|---|
| 3 |
|
|---|
| 4 | #include "threads.h"
|
|---|
| 5 |
|
|---|
| 6 | #define WM_NULL 0x0000
|
|---|
| 7 | #define WM_QUIT 0xffff
|
|---|
| 8 |
|
|---|
| 9 | class MsgQueue
|
|---|
| 10 | {
|
|---|
| 11 | private:
|
|---|
| 12 | int fBreak;
|
|---|
| 13 | int fStart;
|
|---|
| 14 | int fStop;
|
|---|
| 15 |
|
|---|
| 16 | int fMsg; // Message identifier
|
|---|
| 17 | void *fMp; // Message Parameter
|
|---|
| 18 | void *fSize; // Message Parameter Size
|
|---|
| 19 | void *fRc; // Proc return code
|
|---|
| 20 |
|
|---|
| 21 | pthread_t fThread;
|
|---|
| 22 | pthread_mutex_t fMuxMsg;
|
|---|
| 23 | pthread_cond_t fCondMsg;
|
|---|
| 24 | pthread_mutex_t fMuxRc;
|
|---|
| 25 | pthread_cond_t fCondRc;
|
|---|
| 26 |
|
|---|
| 27 | static void *MapThread(void *arg);
|
|---|
| 28 |
|
|---|
| 29 | void Thread();
|
|---|
| 30 |
|
|---|
| 31 | public:
|
|---|
| 32 | MsgQueue();
|
|---|
| 33 | virtual ~MsgQueue();
|
|---|
| 34 |
|
|---|
| 35 | int Break() const { return fBreak; }
|
|---|
| 36 |
|
|---|
| 37 | virtual void *Proc(int msg, void *mp1);
|
|---|
| 38 |
|
|---|
| 39 | void *PostMsg(int msg, void *mp1, int size);
|
|---|
| 40 | };
|
|---|
| 41 |
|
|---|
| 42 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.