Line
Link Here
|
0 |
-- a/src/corelib/arch/qatomic_cxx11.h |
0 |
++ b/src/corelib/arch/qatomic_cxx11.h |
Lines 153-159
template <typename X> struct QAtomicOps
Link Here
|
153 |
template <typename T> |
153 |
template <typename T> |
154 |
static bool testAndSetRelaxed(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW |
154 |
static bool testAndSetRelaxed(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW |
155 |
{ |
155 |
{ |
156 |
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_relaxed); |
156 |
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_relaxed, std::memory_order_relaxed); |
157 |
if (currentValue) |
157 |
if (currentValue) |
158 |
*currentValue = expectedValue; |
158 |
*currentValue = expectedValue; |
159 |
return tmp; |
159 |
return tmp; |
Lines 162-168
template <typename X> struct QAtomicOps
Link Here
|
162 |
template <typename T> |
162 |
template <typename T> |
163 |
static bool testAndSetAcquire(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW |
163 |
static bool testAndSetAcquire(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW |
164 |
{ |
164 |
{ |
165 |
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acquire); |
165 |
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acquire, std::memory_order_acquire); |
166 |
if (currentValue) |
166 |
if (currentValue) |
167 |
*currentValue = expectedValue; |
167 |
*currentValue = expectedValue; |
168 |
return tmp; |
168 |
return tmp; |
Lines 171-177
template <typename X> struct QAtomicOps
Link Here
|
171 |
template <typename T> |
171 |
template <typename T> |
172 |
static bool testAndSetRelease(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW |
172 |
static bool testAndSetRelease(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW |
173 |
{ |
173 |
{ |
174 |
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_release); |
174 |
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_release, std::memory_order_relaxed); |
175 |
if (currentValue) |
175 |
if (currentValue) |
176 |
*currentValue = expectedValue; |
176 |
*currentValue = expectedValue; |
177 |
return tmp; |
177 |
return tmp; |
Lines 180-186
template <typename X> struct QAtomicOps
Link Here
|
180 |
template <typename T> |
180 |
template <typename T> |
181 |
static bool testAndSetOrdered(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW |
181 |
static bool testAndSetOrdered(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW |
182 |
{ |
182 |
{ |
183 |
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acq_rel); |
183 |
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acq_rel, std::memory_order_acquire); |
184 |
if (currentValue) |
184 |
if (currentValue) |
185 |
*currentValue = expectedValue; |
185 |
*currentValue = expectedValue; |
186 |
return tmp; |
186 |
return tmp; |