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

Method start

include/exec/async_scope.hpp:84–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 {}
83
84 void start() & noexcept
85 {
86 // must get lock before checking __active, or if the __active is drained before
87 // the waiter is queued but after __active is checked, the waiter will never be notified
88 std::unique_lock __guard{this->__scope_->__lock_};
89 auto& __active = this->__scope_->__active_;
90 auto& __waiters = this->__scope_->__waiters_;
91 if (__active.load(__std::memory_order_acquire) != 0)
92 {
93 __waiters.push_back(this);
94 return;
95 }
96 __guard.unlock();
97 STDEXEC::start(this->__op_);
98 }
99
100 private:
101 static constexpr void __notify_waiter(__task* __self) noexcept

Callers

nothing calls this directly

Calls 3

startFunction · 0.70
loadMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected