summaryrefslogtreecommitdiffhomepage
path: root/compat/mutex.cpp
blob: 664677eadc427ddf27273ccecb95acf7a304c1ea (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 "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 noexcept
{
    return &inner;
}

mutex::operator QMutex*() const noexcept
{
    return &inner;
}

QMutex* mutex::operator->() const noexcept
{
    return &inner;
}