aboutsummaryrefslogtreecommitdiff
path: root/src/threading/mutex.h
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2016-01-23 05:45:00 +0100
committerest31 <MTest31@outlook.com>2016-01-23 05:45:29 +0100
commite50c784e2ca55735fc360ae51534288c2ea59ca5 (patch)
tree5460f36ef2e8a72ac629548f027956f055502bf1 /src/threading/mutex.h
parent0459eca8eb2e73e9670e00b838dabc9347acb35f (diff)
downloadminetest-e50c784e2ca55735fc360ae51534288c2ea59ca5.tar.gz
minetest-e50c784e2ca55735fc360ae51534288c2ea59ca5.tar.bz2
minetest-e50c784e2ca55735fc360ae51534288c2ea59ca5.zip
Fix C++11 compilability
Previous commits broke it... :(
Diffstat (limited to 'src/threading/mutex.h')
-rw-r--r--src/threading/mutex.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/threading/mutex.h b/src/threading/mutex.h
index 40b10a2ea..dadbd050c 100644
--- a/src/threading/mutex.h
+++ b/src/threading/mutex.h
@@ -30,6 +30,7 @@ DEALINGS IN THE SOFTWARE.
#if __cplusplus >= 201103L && !defined(_WIN32)
#include <mutex>
using Mutex = std::mutex;
+ using RecursiveMutex = std::recursive_mutex;
#else
#ifdef _WIN32
@@ -49,11 +50,14 @@ DEALINGS IN THE SOFTWARE.
class Mutex
{
public:
- Mutex(bool recursive=false);
+ Mutex();
~Mutex();
void lock();
void unlock();
+protected:
+ Mutex(bool recursive);
+ void init_mutex(bool recursive);
private:
#ifdef _WIN32
CRITICAL_SECTION mutex;
@@ -64,6 +68,14 @@ private:
DISABLE_CLASS_COPY(Mutex);
};
+class RecursiveMutex : public Mutex
+{
+public:
+ RecursiveMutex();
+
+ DISABLE_CLASS_COPY(RecursiveMutex);
+};
+
#endif // C++11
#endif