From 4f0156fa4bed1883e20c9f55f9f885e8dd3cb75c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 11 Jun 2025 10:15:04 -0700 Subject: [PATCH] Q*Mutex: unexport for Qt 7 Those weren't caught for the Qt 6.0 release. Pick-to: 6.10 Change-Id: I5831d4ad80b7f60d8782fffd6c64ef552f82ad6e Reviewed-by: Marc Mutz --- src/corelib/thread/qmutex.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h index a45dcee2756..91408467bab 100644 --- a/src/corelib/thread/qmutex.h +++ b/src/corelib/thread/qmutex.h @@ -19,7 +19,7 @@ class QMutex; class QRecursiveMutex; class QMutexPrivate; -class Q_CORE_EXPORT QBasicMutex +class QT6_ONLY(Q_CORE_EXPORT) QBasicMutex { Q_DISABLE_COPY_MOVE(QBasicMutex) protected: @@ -94,17 +94,22 @@ private: } #endif + QT7_ONLY(Q_CORE_EXPORT) void lockInternal() noexcept(FutexAlwaysAvailable); + QT7_ONLY(Q_CORE_EXPORT) bool lockInternal(QDeadlineTimer timeout) noexcept(FutexAlwaysAvailable); #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) bool lockInternal(int timeout) noexcept(FutexAlwaysAvailable); void unlockInternal() noexcept; #endif + QT7_ONLY(Q_CORE_EXPORT) void unlockInternalFutex(void *d) noexcept; + QT7_ONLY(Q_CORE_EXPORT) void unlockInternal(void *d) noexcept; #if QT_CORE_REMOVED_SINCE(6, 9) void destroyInternal(QMutexPrivate *d); #endif + QT7_ONLY(Q_CORE_EXPORT) void destroyInternal(void *d); QBasicAtomicPointer d_ptr; @@ -116,7 +121,7 @@ private: friend class QMutexPrivate; }; -class Q_CORE_EXPORT QMutex : public QBasicMutex +class QT6_ONLY(Q_CORE_EXPORT) QMutex : public QBasicMutex { public: constexpr QMutex() = default; @@ -179,7 +184,7 @@ public: } }; -class Q_CORE_EXPORT QRecursiveMutex +class QT6_ONLY(Q_CORE_EXPORT) QRecursiveMutex { Q_DISABLE_COPY_MOVE(QRecursiveMutex) // written to by the thread that first owns 'mutex'; @@ -192,6 +197,7 @@ class Q_CORE_EXPORT QRecursiveMutex public: constexpr QRecursiveMutex() = default; + QT7_ONLY(Q_CORE_EXPORT) ~QRecursiveMutex(); @@ -200,8 +206,10 @@ public: { tryLock(QDeadlineTimer(QDeadlineTimer::Forever)); } QT_CORE_INLINE_SINCE(6, 6) bool tryLock(int timeout) noexcept(LockIsNoexcept); + QT7_ONLY(Q_CORE_EXPORT) bool tryLock(QDeadlineTimer timer = {}) noexcept(LockIsNoexcept); // BasicLockable concept + QT7_ONLY(Q_CORE_EXPORT) void unlock() noexcept; // Lockable concept