summaryrefslogtreecommitdiffhomepage
path: root/opentrack-compat/qcopyable-mutex.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'opentrack-compat/qcopyable-mutex.hpp')
-rw-r--r--opentrack-compat/qcopyable-mutex.hpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/opentrack-compat/qcopyable-mutex.hpp b/opentrack-compat/qcopyable-mutex.hpp
deleted file mode 100644
index 57b0030d..00000000
--- a/opentrack-compat/qcopyable-mutex.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#pragma once
-
-#include <QMutex>
-
-class MyMutex {
-private:
- QMutex inner;
-
-public:
- QMutex* operator->() { return &inner; }
- QMutex* operator->() const { return &const_cast<MyMutex*>(this)->inner; }
-
- MyMutex operator=(const MyMutex& datum)
- {
- auto mode =
- datum->isRecursive()
- ? QMutex::Recursive
- : QMutex::NonRecursive;
-
- return MyMutex(mode);
- }
-
- MyMutex(const MyMutex& datum)
- {
- *this = datum;
- }
-
- MyMutex(QMutex::RecursionMode mode = QMutex::NonRecursive) :
- inner(mode)
- {
- }
-
- QMutex* operator&() const
- {
- return const_cast<QMutex*>(&inner);
- }
-};