summaryrefslogtreecommitdiffhomepage
path: root/compat/copyable-mutex.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'compat/copyable-mutex.hpp')
-rw-r--r--compat/copyable-mutex.hpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/compat/copyable-mutex.hpp b/compat/copyable-mutex.hpp
index 46c6c88c..37e6802b 100644
--- a/compat/copyable-mutex.hpp
+++ b/compat/copyable-mutex.hpp
@@ -1,25 +1,21 @@
#pragma once
-#include <optional>
-
#include <QMutex>
#include "export.hpp"
class OTR_COMPAT_EXPORT mutex
{
- std::optional<QMutex> inner;
+ mutable QMutex inner;
public:
- enum mode
- {
- recursive = QMutex::Recursive,
- normal = QMutex::NonRecursive,
- };
+ using RecursionMode = QMutex::RecursionMode;
+ static constexpr inline RecursionMode Recursive = RecursionMode::Recursive;
+ static constexpr inline RecursionMode NonRecursive = RecursionMode::NonRecursive;
mutex& operator=(const mutex& datum);
mutex(const mutex& datum);
- explicit mutex(mode m = normal);
+ explicit mutex(RecursionMode m);
QMutex* operator&() const;
operator QMutex*() const;