Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/cleanup/src/lib/util/threads/thread.h @ 10619

Last change on this file since 10619 was 10576, checked in by bensch, 18 years ago

threads better compiled now

File size: 567 bytes
RevLine 
[10575]1#ifndef __THREAD_H__
2#define __THREAD_H__
3
[10576]4#include "threadincl.h"
[10575]5
6namespace 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.