Last change
on this file since 10657 was
10618,
checked in by bknecht, 18 years ago
|
merged cleanup into trunk (only improvements)
|
File size:
567 bytes
|
Line | |
---|
1 | #ifndef __THREAD_H__ |
---|
2 | #define __THREAD_H__ |
---|
3 | |
---|
4 | #include "threadincl.h" |
---|
5 | |
---|
6 | namespace OrxThread |
---|
7 | { |
---|
8 | //! A class for Wrapping Threads |
---|
9 | class Thread |
---|
10 | { |
---|
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); }; |
---|
18 | |
---|
19 | void start(); |
---|
20 | void terminate(); |
---|
21 | |
---|
22 | |
---|
23 | private: |
---|
24 | SDL_Thread* thread; |
---|
25 | |
---|
26 | }; |
---|
27 | } |
---|
28 | |
---|
29 | #endif /* __THREAD_H__ */ |
---|
Note: See
TracBrowser
for help on using the repository browser.