summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qatomic.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-08-06 18:03:49 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-18 18:35:36 +0200
commit2b00f97ab05f144293b26d1e0d8cf4c54d222f92 (patch)
treeef1ff7fa28fdb1449f5e91830adc26c36ef34c6c /src/corelib/thread/qatomic.h
parent624911e48174094c80df7e27b28cc2b2d46f4398 (diff)
Add Q_DECL_CONSTEXPR to the isXXX functions in the new atomics.
This allows one to write code that depends on these values at compile-time. Change-Id: I7d78524ed9c70d4141360496d1d764dcbfa92e62 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/thread/qatomic.h')
-rw-r--r--src/corelib/thread/qatomic.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h
index 2eb0a03cc6..7b0f6bc69f 100644
--- a/src/corelib/thread/qatomic.h
+++ b/src/corelib/thread/qatomic.h
@@ -78,30 +78,30 @@ public:
}
#ifdef qdoc
- static bool isReferenceCountingNative();
- static bool isReferenceCountingWaitFree();
+ static Q_DECL_CONSTEXPR bool isReferenceCountingNative();
+ static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree();
bool ref();
bool deref();
- static bool isTestAndSetNative();
- static bool isTestAndSetWaitFree();
+ static Q_DECL_CONSTEXPR bool isTestAndSetNative();
+ static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree();
bool testAndSetRelaxed(int expectedValue, int newValue);
bool testAndSetAcquire(int expectedValue, int newValue);
bool testAndSetRelease(int expectedValue, int newValue);
bool testAndSetOrdered(int expectedValue, int newValue);
- static bool isFetchAndStoreNative();
- static bool isFetchAndStoreWaitFree();
+ static Q_DECL_CONSTEXPR bool isFetchAndStoreNative();
+ static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree();
int fetchAndStoreRelaxed(int newValue);
int fetchAndStoreAcquire(int newValue);
int fetchAndStoreRelease(int newValue);
int fetchAndStoreOrdered(int newValue);
- static bool isFetchAndAddNative();
- static bool isFetchAndAddWaitFree();
+ static Q_DECL_CONSTEXPR bool isFetchAndAddNative();
+ static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree();
int fetchAndAddRelaxed(int valueToAdd);
int fetchAndAddAcquire(int valueToAdd);
@@ -131,24 +131,24 @@ public:
}
#ifdef qdoc
- static bool isTestAndSetNative();
- static bool isTestAndSetWaitFree();
+ static Q_DECL_CONSTEXPR bool isTestAndSetNative();
+ static Q_DECL_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 bool isFetchAndStoreNative();
- static bool isFetchAndStoreWaitFree();
+ static Q_DECL_CONSTEXPR bool isFetchAndStoreNative();
+ static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree();
T *fetchAndStoreRelaxed(T *newValue);
T *fetchAndStoreAcquire(T *newValue);
T *fetchAndStoreRelease(T *newValue);
T *fetchAndStoreOrdered(T *newValue);
- static bool isFetchAndAddNative();
- static bool isFetchAndAddWaitFree();
+ static Q_DECL_CONSTEXPR bool isFetchAndAddNative();
+ static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree();
T *fetchAndAddRelaxed(qptrdiff valueToAdd);
T *fetchAndAddAcquire(qptrdiff valueToAdd);