summaryrefslogtreecommitdiffhomepage
path: root/compat/copyable-mutex.cpp
blob: 17b5aa34670061f8af6d8e92660b2f1529a14220 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "copyable-mutex.hpp"
#include <cstdlib>

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;
}