summaryrefslogtreecommitdiffhomepage
path: root/compat/mutex.hpp
blob: 37e6802b80a4d10201ecb28f9e42500e7bdbc35b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#include <QMutex>

#include "export.hpp"

class OTR_COMPAT_EXPORT mutex
{
    mutable QMutex inner;

public:
    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(RecursionMode m);

    QMutex* operator&() const;
    operator QMutex*() const;
    QMutex* operator->() const;
};