Last change
on this file since 10637 was
10618,
checked in by bknecht, 18 years ago
|
merged cleanup into trunk (only improvements)
|
File size:
567 bytes
|
Rev | Line | |
---|
[10575] | 1 | #ifndef __THREAD_H__ |
---|
| 2 | #define __THREAD_H__ |
---|
| 3 | |
---|
[10576] | 4 | #include "threadincl.h" |
---|
[10575] | 5 | |
---|
| 6 | namespace OrxThread |
---|
| 7 | { |
---|
| 8 | //! A class for Wrapping Threads |
---|
| 9 | class Thread |
---|
| 10 | { |
---|
[10576] | 11 | public: |
---|
| 12 | Thread(int (*fn)(void *), void *data) { this->thread = SDL_CreateThread(fn, data); }; |
---|
| 13 | virtual ~Thread() { SDL_KillThread(this->thread); } |
---|
| 14 | void exit ( int returnCode = 0 ); |
---|
| 15 | bool isFinished () const; |
---|
| 16 | bool isRunning () const; |
---|
| 17 | void wait() { SDL_WaitThread(this->thread, NULL); }; |
---|
[10575] | 18 | |
---|
[10576] | 19 | void start(); |
---|
| 20 | void terminate(); |
---|
[10575] | 21 | |
---|
| 22 | |
---|
[10576] | 23 | private: |
---|
| 24 | SDL_Thread* thread; |
---|
[10575] | 25 | |
---|
| 26 | }; |
---|
[10576] | 27 | } |
---|
[10575] | 28 | |
---|
| 29 | #endif /* __THREAD_H__ */ |
---|
Note: See
TracBrowser
for help on using the repository browser.