From ea29ea8095e1fe6e7c1766f87aea33650a1a485d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 20 Dec 2018 18:30:37 +0100 Subject: compat/mutex: rename --- compat/mutex.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 compat/mutex.cpp (limited to 'compat/mutex.cpp') diff --git a/compat/mutex.cpp b/compat/mutex.cpp new file mode 100644 index 00000000..55789a22 --- /dev/null +++ b/compat/mutex.cpp @@ -0,0 +1,33 @@ +#include "mutex.hpp" +#include + +mutex& mutex::operator=(const mutex& rhs) +{ + if (rhs->isRecursive() != inner.isRecursive()) + std::abort(); + + return *this; +} + +mutex::mutex(const mutex& datum) : mutex{datum.inner.isRecursive() ? Recursive : NonRecursive} +{ +} + +mutex::mutex(RecursionMode m) : inner{m} +{ +} + +QMutex* mutex::operator&() const +{ + return *this; +} + +mutex::operator QMutex*() const +{ + return &inner; +} + +QMutex* mutex::operator->() const +{ + return *this; +} -- cgit v1.2.3