diff options
Diffstat (limited to 'src/corelib/arch')
-rw-r--r-- | src/corelib/arch/qatomic_bootstrap.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/arch/qatomic_bootstrap.h b/src/corelib/arch/qatomic_bootstrap.h index 7f17387c9c..0d6843a3e5 100644 --- a/src/corelib/arch/qatomic_bootstrap.h +++ b/src/corelib/arch/qatomic_bootstrap.h @@ -67,8 +67,10 @@ template <typename T> struct QAtomicOps: QGenericAtomicOps<QAtomicOps<T> > return --_q_value != 0; } - static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW + static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue = 0) Q_DECL_NOTHROW { + if (currentValue) + *currentValue = _q_value; if (_q_value == expectedValue) { _q_value = newValue; return true; |