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

Method __wait

include/stdexec/stop_token.hpp:86–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84 constexpr __spin_wait() noexcept = default;
85
86 void __wait() noexcept
87 {
88 if (__count_++ < __yield_threshold_)
89 {
90 STDEXEC::__stok::__pause();
91 }
92 else
93 {
94 if (__count_ == 0) // true if __count_ wrapped around
95 __count_ = __yield_threshold_;
96 std::this_thread::yield();
97 }
98 }
99
100 private:
101 static constexpr uint32_t __yield_threshold_ = 20;

Callers 3

__lock_Method · 0.80
__remove_callback_Method · 0.80

Calls 1

__pauseFunction · 0.85

Tested by

no test coverage detected