source:
orxonox.OLD/branches/cleanup/src/lib/util/threads/mutex_locker.h
@
10575
Last change on this file since 10575 was 10574, checked in by bensch, 18 years ago | |
---|---|
File size: 420 bytes |
Line | |
---|---|
1 | #ifndef __MUTEX_LOCKER_H__ |
2 | #define __MUTEX_LOCKER_H__ |
3 | //! A Class that locks a Mutex within its scope |
4 | class MutexLock |
5 | { |
6 | public: |
7 | //! Locks the Mutex mutex in this Scope. |
8 | MutexLock(Mutex* mutex) { SDL_mutexP(mutex->getMutex()); this->mutex = mutex; }; |
9 | ~MutexLock() { SDL_mutexV(mutex->getMutex()); }; |
10 | private: |
11 | Mutex* mutex; //!< The Mutex to lock. |
12 | }; |
13 | } |
14 | |
15 | #endif /* __MUTEX_LOCKER_H__ */ |
Note: See TracBrowser
for help on using the repository browser.