aboutsummaryrefslogtreecommitdiff
path: root/src/threading/mutex.cpp
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.cpp
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.cpp')
-rw-r--r--src/threading/mutex.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/threading/mutex.cpp b/src/threading/mutex.cpp
index e12b79185..f2b07bec3 100644
--- a/src/threading/mutex.cpp
+++ b/src/threading/mutex.cpp
@@ -34,8 +34,19 @@ DEALINGS IN THE SOFTWARE.
#define UNUSED(expr) do { (void)(expr); } while (0)
+Mutex::Mutex()
+{
+ init_mutex(false);
+}
+
+
Mutex::Mutex(bool recursive)
{
+ init_mutex(recursive);
+}
+
+void Mutex::init_mutex(bool recursive)
+{
#ifdef _WIN32
// Windows critical sections are recursive by default
UNUSED(recursive);
@@ -89,5 +100,9 @@ void Mutex::unlock()
#endif
}
+RecursiveMutex::RecursiveMutex()
+ : Mutex(true)
+{}
+
#endif