summaryrefslogtreecommitdiffstats
path: root/src/corelib/arch/qatomic_unix.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-08-06 17:48:42 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-09 03:26:24 +0200
commit6bf4e448fee554153eab09c755ba6fdca012bd52 (patch)
tree0efb1e49ef18b1e80d3bf8bb6569d4a284674a3c /src/corelib/arch/qatomic_unix.h
parent2d9c2c0562aa895b46a7c01902660aa51981e989 (diff)
Mark all atomic functions as Q_DECL_NOTHROW
Actually, only the "new" atomics are marked. The old implementation, based on qoldbasicatomic.h is unchanged, but should still work without a problem. The following configurations were tested and do work: - x86 64-bit - x86 32-bit - generic GCC - generic C++11 std::atomic - bootstrap - ARMv6 and 7 - MIPS - MSVC 2010 32-bit - MSVC 2010 64-bit The only two configurations untested are IA-64 and ARMv5. Except for MSVC, all configurations were tested with GCC 4.6 (MIPS and ARM) and 4.7 (x86 and generics). Change-Id: Iecbfeacd9d20b535453e91335165e9a221e0b47e Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/arch/qatomic_unix.h')
-rw-r--r--src/corelib/arch/qatomic_unix.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/corelib/arch/qatomic_unix.h b/src/corelib/arch/qatomic_unix.h
index 3dc168c0ae..3450596173 100644
--- a/src/corelib/arch/qatomic_unix.h
+++ b/src/corelib/arch/qatomic_unix.h
@@ -76,9 +76,9 @@ struct QAtomicOps<int> : QGenericAtomicOps<QAtomicOps<int> >
{
typedef int Type;
- static inline bool isTestAndSetNative() { return false; }
- static inline bool isTestAndSetWaitFree() { return false; }
- Q_CORE_EXPORT static bool testAndSetRelaxed(int &_q_value, int expectedValue, int newValue);
+ static inline bool isTestAndSetNative() Q_DECL_NOTHROW { return false; }
+ static inline bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return false; }
+ Q_CORE_EXPORT static bool testAndSetRelaxed(int &_q_value, int expectedValue, int newValue) Q_DECL_NOTHROW;
};
template <>
@@ -86,9 +86,9 @@ struct QAtomicOps<void *> : QGenericAtomicOps<QAtomicOps<void *> >
{
typedef void *Type;
- static inline bool isTestAndSetNative() { return false; }
- static inline bool isTestAndSetWaitFree() { return false; }
- Q_CORE_EXPORT static bool testAndSetRelaxed(void *&_q_value, void *expectedValue, void *newValue);
+ static inline bool isTestAndSetNative() Q_DECL_NOTHROW { return false; }
+ static inline bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return false; }
+ Q_CORE_EXPORT static bool testAndSetRelaxed(void *&_q_value, void *expectedValue, void *newValue) Q_DECL_NOTHROW;
};
template <typename T>
@@ -99,9 +99,9 @@ struct QAtomicOps<T *> : QGenericAtomicOps<QAtomicOps<T *> >
// helper to strip cv qualifiers
static inline void *nocv(const T *p) { return const_cast<void *>(static_cast<const volatile void *>(p)); }
- static inline bool isTestAndSetNative() { return false; }
- static inline bool isTestAndSetWaitFree() { return false; }
- static inline bool testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue)
+ static inline bool isTestAndSetNative() Q_DECL_NOTHROW { return false; }
+ static inline bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return false; }
+ static inline bool testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue) Q_DECL_NOTHROW
{
// forward to the void* specialization
void *voidp = nocv(_q_value);