MCPcopy Create free account
hub / github.com/NVIDIA/stdexec / __lock_

Method __lock_

include/stdexec/stop_token.hpp:289–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287 }
288
289 inline auto inplace_stop_source::__lock_() const noexcept -> uint8_t
290 {
291 STDEXEC::__stok::__spin_wait __spin;
292 auto __old_state = __state_.load(STDEXEC::__std::memory_order_relaxed);
293 do
294 {
295 while ((__old_state & __locked_flag_) != 0)
296 {
297 __spin.__wait();
298 __old_state = __state_.load(STDEXEC::__std::memory_order_relaxed);
299 }
300 }
301 while (!__state_.compare_exchange_weak(__old_state,
302 __old_state | __locked_flag_,
303 STDEXEC::__std::memory_order_acquire,
304 STDEXEC::__std::memory_order_relaxed));
305
306 return __old_state;
307 }
308
309 inline void inplace_stop_source::__unlock_(uint8_t __old_state) const noexcept
310 {

Callers

nothing calls this directly

Calls 3

__waitMethod · 0.80
compare_exchange_weakMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected