Use in-class initialization for making it harder to forget to set a default.
[cubemap] / mutexlock.h
1 #ifndef _MUTEXLOCK_H
2 #define _MUTEXLOCK_H 1
3
4 #include <pthread.h>
5
6 // Locks a pthread mutex, RAII-style.
7 class MutexLock {
8 public:
9         MutexLock(pthread_mutex_t *mutex);
10         ~MutexLock();
11
12 private:
13         pthread_mutex_t *mutex;
14 };
15
16 #endif  // !defined(_MUTEXLOCK_H)