| 149 | return __cxx_atomic_load(__platform_state, memory_order_acquire); |
| 150 | } |
| 151 | static void __libcpp_contention_wait(__cxx_atomic_contention_t volatile* __contention_state, |
| 152 | __cxx_atomic_contention_t const volatile* __platform_state, |
| 153 | __cxx_contention_t __old_value) { |
| 154 | __cxx_atomic_fetch_add(__contention_state, __cxx_contention_t(1), memory_order_relaxed); |
| 155 | // https://github.com/llvm/llvm-project/issues/109290 |
| 156 | // There are no platform guarantees of a memory barrier in the platform wait implementation |
| 157 | __cxx_atomic_thread_fence(memory_order_seq_cst); |
| 158 | // We sleep as long as the monitored value hasn't changed. |
| 159 | __libcpp_platform_wait_on_address(__platform_state, __old_value); |
| 160 | __cxx_atomic_fetch_sub(__contention_state, __cxx_contention_t(1), memory_order_release); |
| 161 | } |
| 162 | |
| 163 | /* When the incoming atomic is the wrong size for the platform wait size, need to |
| 164 | launder the value sequence through an atomic from our table. */ |
no test coverage detected