| 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 | #ifndef ROOT_TMutex
|
|---|
| 10 | #include <TMutex.h>
|
|---|
| 11 | #endif
|
|---|
| 12 |
|
|---|
| 13 | class MsgQueue
|
|---|
| 14 | {
|
|---|
| 15 | private:
|
|---|
| 16 | int fBreak;
|
|---|
| 17 | int fStart;
|
|---|
| 18 | int fStop;
|
|---|
| 19 |
|
|---|
| 20 | int fMsg; // Message identifier
|
|---|
| 21 | void *fMp; // Message Parameter
|
|---|
| 22 | void *fSize; // Message Parameter Size
|
|---|
| 23 | void *fRc; // Proc return code
|
|---|
| 24 |
|
|---|
| 25 | pthread_t fThread;
|
|---|
| 26 | TMutex fMuxMsg;
|
|---|
| 27 |
|
|---|
| 28 | static void *MapThread(void *arg);
|
|---|
| 29 |
|
|---|
| 30 | void Thread();
|
|---|
| 31 |
|
|---|
| 32 | public:
|
|---|
| 33 | MsgQueue();
|
|---|
| 34 | virtual ~MsgQueue();
|
|---|
| 35 |
|
|---|
| 36 | int Break() const { return fBreak; }
|
|---|
| 37 |
|
|---|
| 38 | virtual void *Proc(int msg, void *mp1);
|
|---|
| 39 | void *Proc(int msg) { return Proc(msg, 0); }
|
|---|
| 40 |
|
|---|
| 41 | void *PostMsg(int msg, void *mp1, int size);
|
|---|
| 42 | void *PostMsg(int msg) { return PostMsg(msg, 0, 0); }
|
|---|
| 43 | };
|
|---|
| 44 |
|
|---|
| 45 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.