From 00d972fa4f458554cece7f66f1b43f00b0a5458c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 22 Aug 2019 10:46:29 +0200 Subject: [PATCH] QReadWriteLock QT_NO_THREAD shell: make API compatible with the regular one - add missing explicit - drop static from member functions that aren't static in the regular version (ie. all functions) As a drive-by, remove redundant inline keyword where it doesn't cause wanton inconsistency with surrounding code. Change-Id: I5aed73c3afa85d98d97b57c2c1874b1a5e664960 Reviewed-by: Edward Welbourne Reviewed-by: Volker Hilsheimer --- src/corelib/thread/qreadwritelock.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/corelib/thread/qreadwritelock.h b/src/corelib/thread/qreadwritelock.h index 139fde9214..3c1ed91b94 100644 --- a/src/corelib/thread/qreadwritelock.h +++ b/src/corelib/thread/qreadwritelock.h @@ -183,15 +183,15 @@ public: inline explicit QReadWriteLock(RecursionMode = NonRecursive) noexcept { } inline ~QReadWriteLock() { } - static inline void lockForRead() noexcept { } - static inline bool tryLockForRead() noexcept { return true; } - static inline bool tryLockForRead(int timeout) noexcept { Q_UNUSED(timeout); return true; } + void lockForRead() noexcept { } + bool tryLockForRead() noexcept { return true; } + bool tryLockForRead(int timeout) noexcept { Q_UNUSED(timeout); return true; } - static inline void lockForWrite() noexcept { } - static inline bool tryLockForWrite() noexcept { return true; } - static inline bool tryLockForWrite(int timeout) noexcept { Q_UNUSED(timeout); return true; } + void lockForWrite() noexcept { } + bool tryLockForWrite() noexcept { return true; } + bool tryLockForWrite(int timeout) noexcept { Q_UNUSED(timeout); return true; } - static inline void unlock() noexcept { } + void unlock() noexcept { } private: Q_DISABLE_COPY(QReadWriteLock) @@ -200,12 +200,12 @@ private: class Q_CORE_EXPORT QReadLocker { public: - inline QReadLocker(QReadWriteLock *) noexcept { } + inline explicit QReadLocker(QReadWriteLock *) noexcept { } inline ~QReadLocker() noexcept { } - static inline void unlock() noexcept { } - static inline void relock() noexcept { } - static inline QReadWriteLock *readWriteLock() noexcept { return nullptr; } + void unlock() noexcept { } + void relock() noexcept { } + QReadWriteLock *readWriteLock() noexcept { return nullptr; } private: Q_DISABLE_COPY(QReadLocker) @@ -217,9 +217,9 @@ public: inline explicit QWriteLocker(QReadWriteLock *) noexcept { } inline ~QWriteLocker() noexcept { } - static inline void unlock() noexcept { } - static inline void relock() noexcept { } - static inline QReadWriteLock *readWriteLock() noexcept { return nullptr; } + void unlock() noexcept { } + void relock() noexcept { } + QReadWriteLock *readWriteLock() noexcept { return nullptr; } private: Q_DISABLE_COPY(QWriteLocker)