source:
orxonox.OLD/branches/cleanup/src/lib/util/threads/mutex.h
@
10613
Last change on this file since 10613 was 10576, checked in by bensch, 18 years ago | |
---|---|
File size: 422 bytes |
Line | |
---|---|
1 | #ifndef __MUTEX_H__ |
2 | #define __MUTEX_H__ |
3 | |
4 | |
5 | #include "threadincl.h" |
6 | namespace OrxThread |
7 | { |
8 | |
9 | class Mutex |
10 | { |
11 | public: |
12 | Mutex() { this->mutex = SDL_CreateMutex(); }; |
13 | ~Mutex() { SDL_DestroyMutex(this->mutex); } |
14 | |
15 | void lock() { SDL_mutexP(mutex); }; |
16 | void unlock() { SDL_mutexV(mutex); }; |
17 | |
18 | SDL_mutex* getMutex() const { return this->mutex; }; |
19 | private: |
20 | SDL_mutex* mutex; |
21 | }; |
22 | } |
23 | #endif /* __MUTEX_H__ */ |
Note: See TracBrowser
for help on using the repository browser.