Last change
on this file since 10765 was
10618,
checked in by bknecht, 18 years ago
|
merged cleanup into trunk (only improvements)
|
File size:
422 bytes
|
Rev | Line | |
---|
[10574] | 1 | #ifndef __MUTEX_H__ |
---|
| 2 | #define __MUTEX_H__ |
---|
[10576] | 3 | |
---|
| 4 | |
---|
| 5 | #include "threadincl.h" |
---|
| 6 | namespace OrxThread |
---|
[10574] | 7 | { |
---|
[10576] | 8 | |
---|
| 9 | class Mutex |
---|
| 10 | { |
---|
[10574] | 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; |
---|
[10576] | 21 | }; |
---|
| 22 | } |
---|
[10574] | 23 | #endif /* __MUTEX_H__ */ |
---|
Note: See
TracBrowser
for help on using the repository browser.