libstdc++: Strengthen memory order for atomic<T>::wait/notify
This changes the memory order used in the spin wait code to match that of libc++. libstdc++-v3/ChangeLog: * include/bits/atomic_wait.h (__waiter_base::_S_do_spin, __waiter_base::_S_do_spin_v): Change memory order from relaxed to acquire.
This commit is contained in:
parent
c22f3fb780
commit
b25a7c05f1
|
@ -332,7 +332,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
}
|
||||
else
|
||||
{
|
||||
__atomic_load(__addr, &__val, __ATOMIC_RELAXED);
|
||||
__atomic_load(__addr, &__val, __ATOMIC_ACQUIRE);
|
||||
}
|
||||
return __atomic_spin(__pred, __spin);
|
||||
}
|
||||
|
@ -353,7 +353,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
__platform_wait_t& __val,
|
||||
_Spin __spin = _Spin{ })
|
||||
{
|
||||
__atomic_load(__addr, &__val, __ATOMIC_RELAXED);
|
||||
__atomic_load(__addr, &__val, __ATOMIC_ACQUIRE);
|
||||
return __atomic_spin(__pred, __spin);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue