File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -152,8 +152,10 @@ static void __libcpp_contention_wait(__cxx_atomic_contention_t volatile* __conte
152
152
__cxx_atomic_contention_t const volatile * __platform_state,
153
153
__cxx_contention_t __old_value) {
154
154
__cxx_atomic_fetch_add (__contention_state, __cxx_contention_t (1 ), memory_order_relaxed);
155
- // We sleep as long as the monitored value hasn't changed.
155
+ // https://github.com/llvm/llvm-project/issues/109290
156
+ // There are no platform guarantees of a memory barrier in the platform wait implementation
156
157
__cxx_atomic_thread_fence (memory_order_seq_cst);
158
+ // We sleep as long as the monitored value hasn't changed.
157
159
__libcpp_platform_wait_on_address (__platform_state, __old_value);
158
160
__cxx_atomic_fetch_sub (__contention_state, __cxx_contention_t (1 ), memory_order_release);
159
161
}
You can’t perform that action at this time.
0 commit comments