Changeset 10576 in orxonox.OLD for branches/cleanup/src/lib/util/threads/thread.h
- Timestamp:
- Feb 7, 2007, 9:28:52 PM (19 years ago)
- File:
-
- 1 edited
-
branches/cleanup/src/lib/util/threads/thread.h (modified) (2 diffs)
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 public:16 Thread(int (*fn)(void *), void *data) { this->thread = SDL_CreateThread(fn, data); };17 virtual ~Thread() { SDL_KillThread(this->thread); }18 void exit ( int returnCode = 0 );19 bool isFinished () const;20 bool isRunning () const;21 void wait() { SDL_WaitThread(this->thread, NULL); };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 void start();24 void terminate();19 void start(); 20 void terminate(); 25 21 26 22 27 private:28 SDL_Thread* thread;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.










