@@ -151,8 +151,9 @@ __libcpp_contention_monitor_for_wait(__cxx_atomic_contention_t volatile* /*__con
151
151
static void __libcpp_contention_wait (__cxx_atomic_contention_t volatile * __contention_state,
152
152
__cxx_atomic_contention_t const volatile * __platform_state,
153
153
__cxx_contention_t __old_value) {
154
- __cxx_atomic_fetch_add (__contention_state, __cxx_contention_t (1 ), memory_order_seq_cst );
154
+ __cxx_atomic_fetch_add (__contention_state, __cxx_contention_t (1 ), memory_order_relaxed );
155
155
// We sleep as long as the monitored value hasn't changed.
156
+ __cxx_atomic_thread_fence (memory_order_seq_cst);
156
157
__libcpp_platform_wait_on_address (__platform_state, __old_value);
157
158
__cxx_atomic_fetch_sub (__contention_state, __cxx_contention_t (1 ), memory_order_release);
158
159
}
@@ -163,7 +164,7 @@ static void __libcpp_contention_wait(__cxx_atomic_contention_t volatile* __conte
163
164
static void __libcpp_atomic_notify (void const volatile * __location) {
164
165
auto const __entry = __libcpp_contention_state (__location);
165
166
// The value sequence laundering happens on the next line below.
166
- __cxx_atomic_fetch_add (&__entry->__platform_state , __cxx_contention_t (1 ), memory_order_release );
167
+ __cxx_atomic_fetch_add (&__entry->__platform_state , __cxx_contention_t (1 ), memory_order_seq_cst );
167
168
__libcpp_contention_notify (
168
169
&__entry->__contention_state ,
169
170
&__entry->__platform_state ,
0 commit comments