Changeset 10576 in orxonox.OLD for branches/cleanup/src/lib/util/threads/thread.h
- Timestamp:
- Feb 7, 2007, 9:28:52 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cleanup/src/lib/util/threads/thread.h
r10575 r10576 2 2 #define __THREAD_H__ 3 3 4 #ifdef HAVE_SDL_H 5 #include <SDL_thread.h> 6 #else 7 #include <SDL/SDL_thread.h> 8 #endif 4 #include "threadincl.h" 9 5 10 6 namespace OrxThread … … 13 9 class Thread 14 10 { 15 16 17 18 19 20 21 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); }; 22 18 23 24 19 void start(); 20 void terminate(); 25 21 26 22 27 28 23 private: 24 SDL_Thread* thread; 29 25 30 26 }; 27 } 31 28 32 29 #endif /* __THREAD_H__ */
Note: See TracChangeset
for help on using the changeset viewer.