Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/cleanup/src/lib/util/threads/mutex.h @ 10574

Last change on this file since 10574 was 10574, checked in by bensch, 17 years ago

added new thread classes

File size: 375 bytes
Line 
1#ifndef __MUTEX_H__
2#define __MUTEX_H__
3   
4    class Mutex
5{
6  public:
7    Mutex() {  this->mutex = SDL_CreateMutex(); };
8    ~Mutex() { SDL_DestroyMutex(this->mutex); }
9
10    void lock() { SDL_mutexP(mutex); };
11    void unlock() { SDL_mutexV(mutex); };
12
13    SDL_mutex* getMutex() const { return this->mutex; };
14  private:
15    SDL_mutex* mutex;
16};
17
18#endif /* __MUTEX_H__ */
Note: See TracBrowser for help on using the repository browser.