diff options
author | Max Kellermann <max@duempel.org> | 2013-01-07 10:32:01 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-07 10:33:37 +0100 |
commit | a68302e50b835146cdb526a5850b9b19cb36a0ad (patch) | |
tree | 1b6832c3022a78f5b328b73c9c6dbf8370b94f50 /src/thread/Mutex.hxx | |
parent | 333a08ebf9ceb86d5f9354f96321c4c0f704374e (diff) | |
download | mpd-a68302e50b835146cdb526a5850b9b19cb36a0ad.tar.gz mpd-a68302e50b835146cdb526a5850b9b19cb36a0ad.tar.xz mpd-a68302e50b835146cdb526a5850b9b19cb36a0ad.zip |
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.hxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/thread/Mutex.hxx b/src/thread/Mutex.hxx index df8d140c6..675af74b1 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 |