4#ifndef QREADWRITELOCK_H
5#define QREADWRITELOCK_H
7#include <QtCore/qglobal.h>
8#include <QtCore/qdeadlinetimer.h>
19 enum RecursionMode { NonRecursive, Recursive };
21 QT_CORE_INLINE_SINCE(6, 6)
23 QT_CORE_INLINE_SINCE(6, 6)
26 QT_CORE_INLINE_SINCE(6, 6)
28#if QT_CORE_REMOVED_SINCE(6, 6)
29 bool tryLockForRead();
31 QT_CORE_INLINE_SINCE(6, 6)
32 bool tryLockForRead(
int timeout);
35 QT_CORE_INLINE_SINCE(6, 6)
37#if QT_CORE_REMOVED_SINCE(6, 6)
38 bool tryLockForWrite();
40 QT_CORE_INLINE_SINCE(6, 6)
41 bool tryLockForWrite(
int timeout);
54#if QT_CORE_INLINE_IMPL_SINCE(6, 6)
55QReadWriteLock::QReadWriteLock(RecursionMode recursionMode)
56 : d_ptr(recursionMode == Recursive ? initRecursive() :
nullptr)
60QReadWriteLock::~QReadWriteLock()
62 if (
auto d = d_ptr.loadAcquire())
66void QReadWriteLock::lockForRead()
71bool QReadWriteLock::tryLockForRead(
int timeout)
76void QReadWriteLock::lockForWrite()
81bool QReadWriteLock::tryLockForWrite(
int timeout)
88#pragma warning( push )
89#pragma warning( disable : 4312 )
106 readWriteLock()->unlock();
115 readWriteLock()->lockForRead();
130 : q_val(reinterpret_cast<
quintptr>(areadWriteLock))
133 "QReadLocker",
"QReadWriteLock pointer is misaligned");
151 readWriteLock()->unlock();
160 readWriteLock()->lockForWrite();
176 : q_val(reinterpret_cast<
quintptr>(areadWriteLock))
179 "QWriteLocker",
"QReadWriteLock pointer is misaligned");
183#if defined(Q_CC_MSVC)
184#pragma warning( pop )
192 enum RecursionMode { NonRecursive, Recursive };
193 inline explicit QReadWriteLock(RecursionMode = NonRecursive)
noexcept { }
196 void lockForRead() noexcept { }
197 bool tryLockForRead() noexcept {
return true; }
201 void lockForWrite() noexcept { }
202 bool tryLockForWrite() noexcept {
return true; }
206 void unlock() noexcept { }
219 void unlock() noexcept { }
220 void relock() noexcept { }
234 void unlock() noexcept { }
235 void relock() noexcept { }
\macro Q_ATOMIC_INTnn_IS_SUPPORTED
static constexpr ForeverConstant Forever
Combined button and popup list for selecting options.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
GLbitfield GLuint64 timeout
[4]
#define Q_ASSERT_X(cond, x, msg)