From e50c784e2ca55735fc360ae51534288c2ea59ca5 Mon Sep 17 00:00:00 2001 From: est31 Date: Sat, 23 Jan 2016 05:45:00 +0100 Subject: Fix C++11 compilability Previous commits broke it... :( --- src/threading/mutex_auto_lock.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/threading/mutex_auto_lock.h') diff --git a/src/threading/mutex_auto_lock.h b/src/threading/mutex_auto_lock.h index 1c39349e5..25caf7e14 100644 --- a/src/threading/mutex_auto_lock.h +++ b/src/threading/mutex_auto_lock.h @@ -28,7 +28,8 @@ DEALINGS IN THE SOFTWARE. #if __cplusplus >= 201103L #include - using MutexAutoLock = std::lock_guard; + using MutexAutoLock = std::unique_lock; + using RecursiveMutexAutoLock = std::unique_lock; #else #include "threading/mutex.h" @@ -44,6 +45,15 @@ private: Mutex &mutex; }; +class RecursiveMutexAutoLock +{ +public: + RecursiveMutexAutoLock(RecursiveMutex &m) : mutex(m) { mutex.lock(); } + ~RecursiveMutexAutoLock() { mutex.unlock(); } + +private: + RecursiveMutex &mutex; +}; #endif #endif -- cgit v1.2.3