aboutsummaryrefslogtreecommitdiff
path: root/src/thread/Mutex.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-07 10:32:01 +0100
committerMax Kellermann <max@duempel.org>2013-01-07 10:33:37 +0100
commita68302e50b835146cdb526a5850b9b19cb36a0ad (patch)
tree1b6832c3022a78f5b328b73c9c6dbf8370b94f50 /src/thread/Mutex.hxx
parent333a08ebf9ceb86d5f9354f96321c4c0f704374e (diff)
thread/Mutex: don't use std::mutex
Use a custom pthread_mutex_t wrapper because std::mutex adds overhead.
Diffstat (limited to 'src/thread/Mutex.hxx')
-rw-r--r--src/thread/Mutex.hxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/thread/Mutex.hxx b/src/thread/Mutex.hxx
index df8d140c..675af74b 100644
--- a/src/thread/Mutex.hxx
+++ b/src/thread/Mutex.hxx
@@ -27,6 +27,14 @@
#include "CriticalSection.hxx"
typedef CriticalSection Mutex;
+#else
+
+#include "PosixMutex.hxx"
+
+typedef PosixMutex Mutex;
+
+#endif
+
class ScopeLock {
Mutex &mutex;
@@ -43,12 +51,4 @@ public:
ScopeLock &operator=(const ScopeLock &other) = delete;
};
-#else
-
-#include <mutex>
-typedef std::mutex Mutex;
-typedef std::lock_guard<std::mutex> ScopeLock;
-
-#endif
-
#endif