diff options
Diffstat (limited to 'compat/copyable-mutex.hpp')
-rw-r--r-- | compat/copyable-mutex.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/compat/copyable-mutex.hpp b/compat/copyable-mutex.hpp new file mode 100644 index 00000000..af82876d --- /dev/null +++ b/compat/copyable-mutex.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include <memory> + +#include <QMutex> + +#include "export.hpp" + +class OTR_COMPAT_EXPORT mutex +{ + std::unique_ptr<QMutex> inner; + +public: + enum mode + { + recursive = QMutex::Recursive, + normal = QMutex::NonRecursive, + }; + + mutex& operator=(const mutex& datum); + mutex(const mutex& datum); + mutex(mode m = normal); + + QMutex* operator&() const; + operator QMutex*() const; + QMutex* operator->() const; +}; |