Skip to content

Commit 64d2844

Browse files
committed
add comment
1 parent 77d8844 commit 64d2844

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libcxx/src/atomic.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,10 @@ static void __libcpp_contention_wait(__cxx_atomic_contention_t volatile* __conte
152152
__cxx_atomic_contention_t const volatile* __platform_state,
153153
__cxx_contention_t __old_value) {
154154
__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
156157
__cxx_atomic_thread_fence(memory_order_seq_cst);
158+
// We sleep as long as the monitored value hasn't changed.
157159
__libcpp_platform_wait_on_address(__platform_state, __old_value);
158160
__cxx_atomic_fetch_sub(__contention_state, __cxx_contention_t(1), memory_order_release);
159161
}

0 commit comments

Comments
 (0)