qt5base-lts/src/corelib/arch
Marc Mutz 5cc0de2e08 QAtomic: pass explicit failure memory order to std::atomic::compare_exchange_strong
GCC 4.8 seems to get the failure memory order wrong when using the
overload that only accepts one memory order and produces errors such
as:

  bits/atomic_base.h:577:70: error: failure memory model cannot be stronger than success memory model for '__atomic_compare_exchange'
  return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2);
                                                                      ^
(as seen on Android).

Fix by explicitly passing the failure orders corresponding to the
success orders, as specified by the standard:

 relaxed → relaxed
 release → relaxed
 acquire → acquire
 acq_rel → acquire

(cf. http://en.cppreference.com/w/cpp/atomic/atomic/compare_exchange).

Task-number: QTBUG-59399
Change-Id: If046e735888cf331d2d6506d8d5ca9aa7402f9ad
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-03-10 08:24:41 +00:00
..
arch.pri Use qtConfig throughout in qtbase 2016-08-19 04:28:05 +00:00
qatomic_bootstrap.h Updated license headers 2016-01-15 12:25:24 +00:00
qatomic_cxx11.h QAtomic: pass explicit failure memory order to std::atomic::compare_exchange_strong 2017-03-10 08:24:41 +00:00
qatomic_msvc.h QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00