diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-08-06 17:48:42 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-09 03:26:24 +0200 |
commit | 6bf4e448fee554153eab09c755ba6fdca012bd52 (patch) | |
tree | 0efb1e49ef18b1e80d3bf8bb6569d4a284674a3c /src/corelib/arch/qatomic_bootstrap.h | |
parent | 2d9c2c0562aa895b46a7c01902660aa51981e989 (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_bootstrap.h')
-rw-r--r-- | src/corelib/arch/qatomic_bootstrap.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/arch/qatomic_bootstrap.h b/src/corelib/arch/qatomic_bootstrap.h index 75f328b7c7..da6c09b6b3 100644 --- a/src/corelib/arch/qatomic_bootstrap.h +++ b/src/corelib/arch/qatomic_bootstrap.h @@ -62,16 +62,16 @@ template <typename T> struct QAtomicOps: QGenericAtomicOps<QAtomicOps<T> > { typedef T Type; - static bool ref(T &_q_value) + static bool ref(T &_q_value) Q_DECL_NOTHROW { return ++_q_value != 0; } - static bool deref(T &_q_value) + static bool deref(T &_q_value) Q_DECL_NOTHROW { return --_q_value != 0; } - static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) + static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW { if (_q_value == expectedValue) { _q_value = newValue; @@ -80,7 +80,7 @@ template <typename T> struct QAtomicOps: QGenericAtomicOps<QAtomicOps<T> > return false; } - static T fetchAndStoreRelaxed(T &_q_value, T newValue) + static T fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW { T tmp = _q_value; _q_value = newValue; @@ -88,7 +88,7 @@ template <typename T> struct QAtomicOps: QGenericAtomicOps<QAtomicOps<T> > } static - T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) + T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW { T returnValue = _q_value; _q_value += valueToAdd; |