4#ifndef QORDEREDMUTEXLOCKER_P_H
5#define QORDEREDMUTEXLOCKER_P_H
18#include <QtCore/private/qglobal_p.h>
19#include <QtCore/qmutex.h>
36 : mtx1((m1 == m2) ? m1 : (
std::less<
QBasicMutex *>()(m1, m2) ? m1 : m2)),
56 : mtx1(std::exchange(
other.mtx1,
nullptr))
57 , mtx2(std::exchange(
other.mtx2,
nullptr))
58 , locked(std::exchange(
other.locked,
false))
69 if (mtx1) mtx1->lock();
70 if (mtx2) mtx2->lock();
93 if (mtx2) mtx2->unlock();
94 if (mtx1) mtx1->unlock();
104 if (std::less<QBasicMutex *>()(mtx1, mtx2)) {
bool tryLock(int timeout=0) noexcept
Attempts to lock the mutex.
void unlock() noexcept
Unlocks the mutex.
void lock() noexcept
Locks the mutex.
QOrderedMutexLocker & operator=(QOrderedMutexLocker &&other)=default
Q_NODISCARD_CTOR QOrderedMutexLocker(QBasicMutex *, QBasicMutex *)
Q_NODISCARD_CTOR QOrderedMutexLocker(QOrderedMutexLocker &&)=default
static bool relock(QBasicMutex *, QBasicMutex *)
Combined button and popup list for selecting options.