From 94b7a4f9b8d0746dae54b0a1870f119e8b17830d Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 20 Jul 2020 13:59:22 +0200 Subject: [PATCH] QAtomic*: purge deprecated load() and save() methods Deprecated in 5.14 in favor of loadRelaxed() and storeRelaxed(). Caught one surviving use of load() in the ios platform plugin. Change-Id: I9518064a948e5d26ccb956490cbb0561bed5d8b5 Reviewed-by: Lars Knoll --- src/corelib/thread/qatomic.cpp | 52 +------------------ src/corelib/thread/qatomic.h | 4 -- src/corelib/thread/qbasicatomic.h | 13 +---- .../platforms/ios/qioseventdispatcher.mm | 5 +- 4 files changed, 6 insertions(+), 68 deletions(-) diff --git a/src/corelib/thread/qatomic.cpp b/src/corelib/thread/qatomic.cpp index d302da72ebe..43f1a4e0d53 100644 --- a/src/corelib/thread/qatomic.cpp +++ b/src/corelib/thread/qatomic.cpp @@ -260,19 +260,6 @@ */ -/*! - \fn template T QAtomicInteger::load() const - \obsolete - - Use loadRelaxed() instead. - - Atomically loads the value of this QAtomicInteger using relaxed memory - ordering. The value is not modified in any way, but note that there's no - guarantee that it remains so. - - \sa storeRelaxed(), loadAcquire() -*/ - /*! \fn template T QAtomicInteger::loadRelaxed() const \since 5.14 @@ -294,18 +281,6 @@ \sa storeRelaxed(), loadRelaxed() */ -/*! - \fn template void QAtomicInteger::store(T newValue) - \obsolete - - Use storeRelaxed() instead. - - Atomically stores the \a newValue value into this atomic type, using - relaxed memory ordering. - - \sa storeRelease(), loadRelaxed() -*/ - /*! \fn template void QAtomicInteger::storeRelaxed(T newValue) \since 5.14 @@ -322,7 +297,7 @@ Atomically stores the \a newValue value into this atomic type, using the "Release" memory ordering. - \sa store(), loadAcquire() + \sa storeRelaxed(), loadAcquire() */ /*! @@ -1353,19 +1328,6 @@ this QAtomicPointer. */ -/*! - \fn template T *QAtomicPointer::load() const - \obsolete - - Use loadRelaxed() instead. - - Atomically loads the value of this QAtomicPointer using relaxed memory - ordering. The value is not modified in any way, but note that there's no - guarantee that it remains so. - - \sa storeRelaxed(), loadAcquire() -*/ - /*! \fn template T *QAtomicPointer::loadRelaxed() const \since 5.14 @@ -1388,18 +1350,6 @@ \sa storeRelease(), loadRelaxed() */ -/*! - \fn template void QAtomicPointer::store(T *newValue) - \obsolete - - Use storeRelaxed() instead. - - Atomically stores the \a newValue value into this atomic type, using - relaxed memory ordering. - - \sa storeRelease(), loadRelaxed() -*/ - /*! \fn template void QAtomicPointer::storeRelaxed(T *newValue) \since 5.14 diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h index aa57ddc610a..26000ba7dfc 100644 --- a/src/corelib/thread/qatomic.h +++ b/src/corelib/thread/qatomic.h @@ -84,10 +84,8 @@ public: } #ifdef Q_CLANG_QDOC - T load() const; T loadRelaxed() const; T loadAcquire() const; - void store(T newValue); void storeRelaxed(T newValue); void storeRelease(T newValue); @@ -196,10 +194,8 @@ public: } #ifdef Q_QDOC - T *load() const; T *loadAcquire() const; T *loadRelaxed() const; - void store(T *newValue); void storeRelaxed(T *newValue); void storeRelease(T *newValue); diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index 18da268270d..c02403d766b 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -98,12 +98,8 @@ public: typename Ops::Type _q_value; - // Everything below is either implemented in ../arch/qatomic_XXX.h or (as fallback) in qgenericatomic.h -#if QT_DEPRECATED_SINCE(5, 14) - QT_DEPRECATED_VERSION_X_5_14("Use loadRelaxed") T load() const noexcept { return loadRelaxed(); } - QT_DEPRECATED_VERSION_X_5_14("Use storeRelaxed") void store(T newValue) noexcept { storeRelaxed(newValue); } -#endif - + // Everything below is either implemented in ../arch/qatomic_XXX.h or (as + // fallback) in qgenericatomic.h T loadRelaxed() const noexcept { return Ops::loadRelaxed(_q_value); } void storeRelaxed(T newValue) noexcept { Ops::storeRelaxed(_q_value, newValue); } @@ -240,11 +236,6 @@ public: AtomicType _q_value; -#if QT_DEPRECATED_SINCE(5, 14) - QT_DEPRECATED_VERSION_X_5_14("Use loadRelaxed") Type load() const noexcept { return loadRelaxed(); } - QT_DEPRECATED_VERSION_X_5_14("Use storeRelaxed") void store(Type newValue) noexcept { storeRelaxed(newValue); } -#endif - Type loadRelaxed() const noexcept { return Ops::loadRelaxed(_q_value); } void storeRelaxed(Type newValue) noexcept { Ops::storeRelaxed(_q_value, newValue); } diff --git a/src/plugins/platforms/ios/qioseventdispatcher.mm b/src/plugins/platforms/ios/qioseventdispatcher.mm index c5856051de6..23aac6ad467 100644 --- a/src/plugins/platforms/ios/qioseventdispatcher.mm +++ b/src/plugins/platforms/ios/qioseventdispatcher.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. @@ -473,7 +473,8 @@ bool QIOSEventDispatcher::processPostedEvents() return false; QT_APPLE_SCOPED_LOG_ACTIVITY(lcEventDispatcher().isDebugEnabled(), "sendWindowSystemEvents"); - QEventLoop::ProcessEventsFlags flags = QEventLoop::ProcessEventsFlags(m_processEvents.flags.load()); + QEventLoop::ProcessEventsFlags flags + = QEventLoop::ProcessEventsFlags(m_processEvents.flags.loadRelaxed()); qCDebug(lcEventDispatcher) << "Sending window system events for" << flags; QWindowSystemInterface::sendWindowSystemEvents(flags);