diff options
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qatomic.h | 28 | ||||
-rw-r--r-- | src/corelib/thread/qatomic_cxx11.h | 42 | ||||
-rw-r--r-- | src/corelib/thread/qatomic_msvc.h | 28 | ||||
-rw-r--r-- | src/corelib/thread/qbasicatomic.h | 28 | ||||
-rw-r--r-- | src/corelib/thread/qfutex_p.h | 2 | ||||
-rw-r--r-- | src/corelib/thread/qgenericatomic.h | 16 | ||||
-rw-r--r-- | src/corelib/thread/qmutex.h | 2 | ||||
-rw-r--r-- | src/corelib/thread/qsemaphore.cpp | 4 |
8 files changed, 75 insertions, 75 deletions
diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h index 26000ba7df..2080167d2c 100644 --- a/src/corelib/thread/qatomic.h +++ b/src/corelib/thread/qatomic.h @@ -92,30 +92,30 @@ public: operator T() const; QAtomicInteger &operator=(T); - static Q_DECL_CONSTEXPR bool isReferenceCountingNative(); - static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree(); + static constexpr bool isReferenceCountingNative(); + static constexpr bool isReferenceCountingWaitFree(); bool ref(); bool deref(); - static Q_DECL_CONSTEXPR bool isTestAndSetNative(); - static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree(); + static constexpr bool isTestAndSetNative(); + static constexpr bool isTestAndSetWaitFree(); bool testAndSetRelaxed(T expectedValue, T newValue); bool testAndSetAcquire(T expectedValue, T newValue); bool testAndSetRelease(T expectedValue, T newValue); bool testAndSetOrdered(T expectedValue, T newValue); - static Q_DECL_CONSTEXPR bool isFetchAndStoreNative(); - static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree(); + static constexpr bool isFetchAndStoreNative(); + static constexpr bool isFetchAndStoreWaitFree(); T fetchAndStoreRelaxed(T newValue); T fetchAndStoreAcquire(T newValue); T fetchAndStoreRelease(T newValue); T fetchAndStoreOrdered(T newValue); - static Q_DECL_CONSTEXPR bool isFetchAndAddNative(); - static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree(); + static constexpr bool isFetchAndAddNative(); + static constexpr bool isFetchAndAddWaitFree(); T fetchAndAddRelaxed(T valueToAdd); T fetchAndAddAcquire(T valueToAdd); @@ -199,24 +199,24 @@ public: void storeRelaxed(T *newValue); void storeRelease(T *newValue); - static Q_DECL_CONSTEXPR bool isTestAndSetNative(); - static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree(); + static constexpr bool isTestAndSetNative(); + static constexpr bool isTestAndSetWaitFree(); bool testAndSetRelaxed(T *expectedValue, T *newValue); bool testAndSetAcquire(T *expectedValue, T *newValue); bool testAndSetRelease(T *expectedValue, T *newValue); bool testAndSetOrdered(T *expectedValue, T *newValue); - static Q_DECL_CONSTEXPR bool isFetchAndStoreNative(); - static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree(); + static constexpr bool isFetchAndStoreNative(); + static constexpr bool isFetchAndStoreWaitFree(); T *fetchAndStoreRelaxed(T *newValue); T *fetchAndStoreAcquire(T *newValue); T *fetchAndStoreRelease(T *newValue); T *fetchAndStoreOrdered(T *newValue); - static Q_DECL_CONSTEXPR bool isFetchAndAddNative(); - static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree(); + static constexpr bool isFetchAndAddNative(); + static constexpr bool isFetchAndAddWaitFree(); T *fetchAndAddRelaxed(qptrdiff valueToAdd); T *fetchAndAddAcquire(qptrdiff valueToAdd); diff --git a/src/corelib/thread/qatomic_cxx11.h b/src/corelib/thread/qatomic_cxx11.h index 9669554515..89676369f7 100644 --- a/src/corelib/thread/qatomic_cxx11.h +++ b/src/corelib/thread/qatomic_cxx11.h @@ -73,7 +73,7 @@ QT_END_NAMESPACE // ### Qt 6: make non-constexpr (see above) template <int N> struct QAtomicTraits -{ static Q_DECL_CONSTEXPR inline bool isLockFree(); }; +{ static constexpr inline bool isLockFree(); }; #define Q_ATOMIC_INT32_IS_SUPPORTED #if ATOMIC_INT_LOCK_FREE == 2 @@ -86,7 +86,7 @@ template <int N> struct QAtomicTraits # define Q_ATOMIC_INT32_FETCH_AND_STORE_IS_ALWAYS_NATIVE # define Q_ATOMIC_INT32_FETCH_AND_ADD_IS_ALWAYS_NATIVE -template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<4>::isLockFree() +template <> constexpr inline bool QAtomicTraits<4>::isLockFree() { return true; } #elif ATOMIC_INT_LOCK_FREE == 1 # define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_SOMETIMES_NATIVE @@ -98,7 +98,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<4>::isLockFree() # define Q_ATOMIC_INT32_FETCH_AND_STORE_IS_SOMETIMES_NATIVE # define Q_ATOMIC_INT32_FETCH_AND_ADD_IS_SOMETIMES_NATIVE -template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<4>::isLockFree() +template <> constexpr inline bool QAtomicTraits<4>::isLockFree() { return false; } #else # define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NEVER_NATIVE @@ -110,7 +110,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<4>::isLockFree() # define Q_ATOMIC_INT32_FETCH_AND_STORE_IS_NEVER_NATIVE # define Q_ATOMIC_INT32_FETCH_AND_ADD_IS_NEVER_NATIVE -template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<4>::isLockFree() +template <> constexpr inline bool QAtomicTraits<4>::isLockFree() { return false; } #endif @@ -139,7 +139,7 @@ template<> struct QAtomicOpsSupport<1> { enum { IsSupported = 1 }; }; # define Q_ATOMIC_INT8_FETCH_AND_STORE_IS_ALWAYS_NATIVE # define Q_ATOMIC_INT8_FETCH_AND_ADD_IS_ALWAYS_NATIVE -template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<1>::isLockFree() +template <> constexpr inline bool QAtomicTraits<1>::isLockFree() { return true; } #elif ATOMIC_CHAR_LOCK_FREE == 1 # define Q_ATOMIC_INT8_REFERENCE_COUNTING_IS_SOMETIMES_NATIVE @@ -147,7 +147,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<1>::isLockFree() # define Q_ATOMIC_INT8_FETCH_AND_STORE_IS_SOMETIMES_NATIVE # define Q_ATOMIC_INT8_FETCH_AND_ADD_IS_SOMETIMES_NATIVE -template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<1>::isLockFree() +template <> constexpr inline bool QAtomicTraits<1>::isLockFree() { return false; } #else # define Q_ATOMIC_INT8_REFERENCE_COUNTING_IS_NEVER_NATIVE @@ -155,7 +155,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<1>::isLockFree() # define Q_ATOMIC_INT8_FETCH_AND_STORE_IS_NEVER_NATIVE # define Q_ATOMIC_INT8_FETCH_AND_ADD_IS_NEVER_NATIVE -template <> Q_DECL_CONSTEXPR bool QAtomicTraits<1>::isLockFree() +template <> constexpr bool QAtomicTraits<1>::isLockFree() { return false; } #endif @@ -167,7 +167,7 @@ template<> struct QAtomicOpsSupport<2> { enum { IsSupported = 1 }; }; # define Q_ATOMIC_INT16_FETCH_AND_STORE_IS_ALWAYS_NATIVE # define Q_ATOMIC_INT16_FETCH_AND_ADD_IS_ALWAYS_NATIVE -template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree() +template <> constexpr inline bool QAtomicTraits<2>::isLockFree() { return false; } #elif ATOMIC_SHORT_LOCK_FREE == 1 # define Q_ATOMIC_INT16_REFERENCE_COUNTING_IS_SOMETIMES_NATIVE @@ -175,7 +175,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree() # define Q_ATOMIC_INT16_FETCH_AND_STORE_IS_SOMETIMES_NATIVE # define Q_ATOMIC_INT16_FETCH_AND_ADD_IS_SOMETIMES_NATIVE -template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree() +template <> constexpr inline bool QAtomicTraits<2>::isLockFree() { return false; } #else # define Q_ATOMIC_INT16_REFERENCE_COUNTING_IS_NEVER_NATIVE @@ -183,7 +183,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree() # define Q_ATOMIC_INT16_FETCH_AND_STORE_IS_NEVER_NATIVE # define Q_ATOMIC_INT16_FETCH_AND_ADD_IS_NEVER_NATIVE -template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree() +template <> constexpr inline bool QAtomicTraits<2>::isLockFree() { return false; } #endif @@ -196,7 +196,7 @@ template<> struct QAtomicOpsSupport<8> { enum { IsSupported = 1 }; }; # define Q_ATOMIC_INT64_FETCH_AND_STORE_IS_ALWAYS_NATIVE # define Q_ATOMIC_INT64_FETCH_AND_ADD_IS_ALWAYS_NATIVE -template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree() +template <> constexpr inline bool QAtomicTraits<8>::isLockFree() { return true; } # elif ATOMIC_LLONG_LOCK_FREE == 1 # define Q_ATOMIC_INT64_REFERENCE_COUNTING_IS_SOMETIMES_NATIVE @@ -204,7 +204,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree() # define Q_ATOMIC_INT64_FETCH_AND_STORE_IS_SOMETIMES_NATIVE # define Q_ATOMIC_INT64_FETCH_AND_ADD_IS_SOMETIMES_NATIVE -template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree() +template <> constexpr inline bool QAtomicTraits<8>::isLockFree() { return false; } # else # define Q_ATOMIC_INT64_REFERENCE_COUNTING_IS_NEVER_NATIVE @@ -212,7 +212,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree() # define Q_ATOMIC_INT64_FETCH_AND_STORE_IS_NEVER_NATIVE # define Q_ATOMIC_INT64_FETCH_AND_ADD_IS_NEVER_NATIVE -template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree() +template <> constexpr inline bool QAtomicTraits<8>::isLockFree() { return false; } # endif #endif @@ -275,8 +275,8 @@ template <typename X> struct QAtomicOps _q_value.store(newValue, std::memory_order_release); } - static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() noexcept { return isTestAndSetNative(); } - static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() noexcept { return false; } + static inline constexpr bool isReferenceCountingNative() noexcept { return isTestAndSetNative(); } + static inline constexpr bool isReferenceCountingWaitFree() noexcept { return false; } template <typename T> static inline bool ref(std::atomic<T> &_q_value) { @@ -289,9 +289,9 @@ template <typename X> struct QAtomicOps return --_q_value != 0; } - static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept + static inline constexpr bool isTestAndSetNative() noexcept { return QAtomicTraits<sizeof(X)>::isLockFree(); } - static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept { return false; } + static inline constexpr bool isTestAndSetWaitFree() noexcept { return false; } template <typename T> static bool testAndSetRelaxed(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) noexcept @@ -329,8 +329,8 @@ template <typename X> struct QAtomicOps return tmp; } - static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return isTestAndSetNative(); } - static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return false; } + static inline constexpr bool isFetchAndStoreNative() noexcept { return isTestAndSetNative(); } + static inline constexpr bool isFetchAndStoreWaitFree() noexcept { return false; } template <typename T> static T fetchAndStoreRelaxed(std::atomic<T> &_q_value, T newValue) noexcept @@ -356,8 +356,8 @@ template <typename X> struct QAtomicOps return _q_value.exchange(newValue, std::memory_order_acq_rel); } - static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return isTestAndSetNative(); } - static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return false; } + static inline constexpr bool isFetchAndAddNative() noexcept { return isTestAndSetNative(); } + static inline constexpr bool isFetchAndAddWaitFree() noexcept { return false; } template <typename T> static inline T fetchAndAddRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept diff --git a/src/corelib/thread/qatomic_msvc.h b/src/corelib/thread/qatomic_msvc.h index 54b12f5bb2..c872cd7231 100644 --- a/src/corelib/thread/qatomic_msvc.h +++ b/src/corelib/thread/qatomic_msvc.h @@ -269,23 +269,23 @@ template <> struct QAtomicWindowsType<4> { typedef long Type; }; template <int N> struct QAtomicOpsBySize : QGenericAtomicOps<QAtomicOpsBySize<N> > { - static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() noexcept { return true; } - static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() noexcept { return true; } + static inline constexpr bool isReferenceCountingNative() noexcept { return true; } + static inline constexpr bool isReferenceCountingWaitFree() noexcept { return true; } template <typename T> static bool ref(T &_q_value) noexcept; template <typename T> static bool deref(T &_q_value) noexcept; - static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept { return true; } - static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept { return true; } + static inline constexpr bool isTestAndSetNative() noexcept { return true; } + static inline constexpr bool isTestAndSetWaitFree() noexcept { return true; } template <typename T> static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) noexcept; template <typename T> static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) noexcept; - static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return true; } - static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return true; } + static inline constexpr bool isFetchAndStoreNative() noexcept { return true; } + static inline constexpr bool isFetchAndStoreWaitFree() noexcept { return true; } template <typename T> static T fetchAndStoreRelaxed(T &_q_value, T newValue) noexcept; - static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return true; } - static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return true; } + static inline constexpr bool isFetchAndAddNative() noexcept { return true; } + static inline constexpr bool isFetchAndAddWaitFree() noexcept { return true; } template <typename T> static T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept; private: @@ -423,17 +423,17 @@ struct QAtomicOps<T *> : QGenericAtomicOps<QAtomicOps<T *> > { typedef T *Type; - static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept { return true; } - static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept { return true; } + static inline constexpr bool isTestAndSetNative() noexcept { return true; } + static inline constexpr bool isTestAndSetWaitFree() noexcept { return true; } static bool testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue) noexcept; static bool testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue, T **currentValue) noexcept; - static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return true; } - static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return true; } + static inline constexpr bool isFetchAndStoreNative() noexcept { return true; } + static inline constexpr bool isFetchAndStoreWaitFree() noexcept { return true; } static T *fetchAndStoreRelaxed(T *&_q_value, T *newValue) noexcept; - static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return true; } - static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return true; } + static inline constexpr bool isFetchAndAddNative() noexcept { return true; } + static inline constexpr bool isFetchAndAddWaitFree() noexcept { return true; } static T *fetchAndAddRelaxed(T *&_q_value, qptrdiff valueToAdd) noexcept; }; diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index c02403d766..8c6440a7d7 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -108,14 +108,14 @@ public: operator T() const noexcept { return loadAcquire(); } T operator=(T newValue) noexcept { storeRelease(newValue); return newValue; } - static Q_DECL_CONSTEXPR bool isReferenceCountingNative() noexcept { return Ops::isReferenceCountingNative(); } - static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() noexcept { return Ops::isReferenceCountingWaitFree(); } + static constexpr bool isReferenceCountingNative() noexcept { return Ops::isReferenceCountingNative(); } + static constexpr bool isReferenceCountingWaitFree() noexcept { return Ops::isReferenceCountingWaitFree(); } bool ref() noexcept { return Ops::ref(_q_value); } bool deref() noexcept { return Ops::deref(_q_value); } - static Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept { return Ops::isTestAndSetNative(); } - static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept { return Ops::isTestAndSetWaitFree(); } + static constexpr bool isTestAndSetNative() noexcept { return Ops::isTestAndSetNative(); } + static constexpr bool isTestAndSetWaitFree() noexcept { return Ops::isTestAndSetWaitFree(); } bool testAndSetRelaxed(T expectedValue, T newValue) noexcept { return Ops::testAndSetRelaxed(_q_value, expectedValue, newValue); } @@ -135,8 +135,8 @@ public: bool testAndSetOrdered(T expectedValue, T newValue, T ¤tValue) noexcept { return Ops::testAndSetOrdered(_q_value, expectedValue, newValue, ¤tValue); } - static Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return Ops::isFetchAndStoreNative(); } - static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return Ops::isFetchAndStoreWaitFree(); } + static constexpr bool isFetchAndStoreNative() noexcept { return Ops::isFetchAndStoreNative(); } + static constexpr bool isFetchAndStoreWaitFree() noexcept { return Ops::isFetchAndStoreWaitFree(); } T fetchAndStoreRelaxed(T newValue) noexcept { return Ops::fetchAndStoreRelaxed(_q_value, newValue); } @@ -147,8 +147,8 @@ public: T fetchAndStoreOrdered(T newValue) noexcept { return Ops::fetchAndStoreOrdered(_q_value, newValue); } - static Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return Ops::isFetchAndAddNative(); } - static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return Ops::isFetchAndAddWaitFree(); } + static constexpr bool isFetchAndAddNative() noexcept { return Ops::isFetchAndAddNative(); } + static constexpr bool isFetchAndAddWaitFree() noexcept { return Ops::isFetchAndAddWaitFree(); } T fetchAndAddRelaxed(T valueToAdd) noexcept { return Ops::fetchAndAddRelaxed(_q_value, valueToAdd); } @@ -246,8 +246,8 @@ public: Type loadAcquire() const noexcept { return Ops::loadAcquire(_q_value); } void storeRelease(Type newValue) noexcept { Ops::storeRelease(_q_value, newValue); } - static Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept { return Ops::isTestAndSetNative(); } - static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept { return Ops::isTestAndSetWaitFree(); } + static constexpr bool isTestAndSetNative() noexcept { return Ops::isTestAndSetNative(); } + static constexpr bool isTestAndSetWaitFree() noexcept { return Ops::isTestAndSetWaitFree(); } bool testAndSetRelaxed(Type expectedValue, Type newValue) noexcept { return Ops::testAndSetRelaxed(_q_value, expectedValue, newValue); } @@ -267,8 +267,8 @@ public: bool testAndSetOrdered(Type expectedValue, Type newValue, Type ¤tValue) noexcept { return Ops::testAndSetOrdered(_q_value, expectedValue, newValue, ¤tValue); } - static Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return Ops::isFetchAndStoreNative(); } - static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return Ops::isFetchAndStoreWaitFree(); } + static constexpr bool isFetchAndStoreNative() noexcept { return Ops::isFetchAndStoreNative(); } + static constexpr bool isFetchAndStoreWaitFree() noexcept { return Ops::isFetchAndStoreWaitFree(); } Type fetchAndStoreRelaxed(Type newValue) noexcept { return Ops::fetchAndStoreRelaxed(_q_value, newValue); } @@ -279,8 +279,8 @@ public: Type fetchAndStoreOrdered(Type newValue) noexcept { return Ops::fetchAndStoreOrdered(_q_value, newValue); } - static Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return Ops::isFetchAndAddNative(); } - static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return Ops::isFetchAndAddWaitFree(); } + static constexpr bool isFetchAndAddNative() noexcept { return Ops::isFetchAndAddNative(); } + static constexpr bool isFetchAndAddWaitFree() noexcept { return Ops::isFetchAndAddWaitFree(); } Type fetchAndAddRelaxed(qptrdiff valueToAdd) noexcept { return Ops::fetchAndAddRelaxed(_q_value, valueToAdd); } diff --git a/src/corelib/thread/qfutex_p.h b/src/corelib/thread/qfutex_p.h index f287b752d7..9ace807b91 100644 --- a/src/corelib/thread/qfutex_p.h +++ b/src/corelib/thread/qfutex_p.h @@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE namespace QtDummyFutex { - Q_DECL_CONSTEXPR inline bool futexAvailable() { return false; } + constexpr inline bool futexAvailable() { return false; } template <typename Atomic> inline bool futexWait(Atomic &, typename Atomic::Type, int = 0) { Q_UNREACHABLE(); return false; } diff --git a/src/corelib/thread/qgenericatomic.h b/src/corelib/thread/qgenericatomic.h index e9e5f3c74b..0fa9a9a418 100644 --- a/src/corelib/thread/qgenericatomic.h +++ b/src/corelib/thread/qgenericatomic.h @@ -123,9 +123,9 @@ template <typename BaseClass> struct QGenericAtomicOps *static_cast<volatile T *>(&_q_value) = newValue; } - static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() noexcept + static inline constexpr bool isReferenceCountingNative() noexcept { return BaseClass::isFetchAndAddNative(); } - static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() noexcept + static inline constexpr bool isReferenceCountingWaitFree() noexcept { return BaseClass::isFetchAndAddWaitFree(); } template <typename T> static Q_ALWAYS_INLINE bool ref(T &_q_value) noexcept @@ -142,8 +142,8 @@ template <typename BaseClass> struct QGenericAtomicOps #if 0 // These functions have no default implementation // Archictectures must implement them - static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept; - static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept; + static inline constexpr bool isTestAndSetNative() noexcept; + static inline constexpr bool isTestAndSetWaitFree() noexcept; template <typename T, typename X> static inline bool testAndSetRelaxed(T &_q_value, X expectedValue, X newValue) noexcept; template <typename T, typename X> static inline @@ -194,8 +194,8 @@ template <typename BaseClass> struct QGenericAtomicOps return BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue, currentValue); } - static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return false; } - static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return false; } + static inline constexpr bool isFetchAndStoreNative() noexcept { return false; } + static inline constexpr bool isFetchAndStoreWaitFree() noexcept { return false; } template <typename T, typename X> static Q_ALWAYS_INLINE T fetchAndStoreRelaxed(T &_q_value, X newValue) noexcept @@ -230,8 +230,8 @@ template <typename BaseClass> struct QGenericAtomicOps return BaseClass::fetchAndStoreRelaxed(_q_value, newValue); } - static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return false; } - static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return false; } + static inline constexpr bool isFetchAndAddNative() noexcept { return false; } + static inline constexpr bool isFetchAndAddWaitFree() noexcept { return false; } template <typename T> static Q_ALWAYS_INLINE T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept { diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h index 93c4bf23e8..8ac6088c12 100644 --- a/src/corelib/thread/qmutex.h +++ b/src/corelib/thread/qmutex.h @@ -287,7 +287,7 @@ class Q_CORE_EXPORT QMutex public: enum RecursionMode { NonRecursive, Recursive }; - inline Q_DECL_CONSTEXPR explicit QMutex(RecursionMode = NonRecursive) noexcept { } + inline constexpr explicit QMutex(RecursionMode = NonRecursive) noexcept { } inline void lock() noexcept {} inline bool tryLock(int timeout = 0) noexcept { Q_UNUSED(timeout); return true; } diff --git a/src/corelib/thread/qsemaphore.cpp b/src/corelib/thread/qsemaphore.cpp index d4fb756b94..ee4cee5281 100644 --- a/src/corelib/thread/qsemaphore.cpp +++ b/src/corelib/thread/qsemaphore.cpp @@ -127,9 +127,9 @@ using namespace QtFutex; */ #if defined(FUTEX_OP) && QT_POINTER_SIZE > 4 -static Q_CONSTEXPR bool futexHasWaiterCount = true; +static constexpr bool futexHasWaiterCount = true; #else -static Q_CONSTEXPR bool futexHasWaiterCount = false; +static constexpr bool futexHasWaiterCount = false; #endif static const quintptr futexNeedsWakeAllBit = |