55 void await_suspend(std::coroutine_handle<Vruta::conditional_promise> handle)
57 auto& p = handle.promise();
59 p.armed.store(
true, std::memory_order_release);
void await_suspend(std::coroutine_handle< Vruta::conditional_promise > handle)
Arm the promise with the condition and the coroutine handle.
std::function< bool()> m_condition
void await_resume() const
No value to return on resumption.
ConditionAwaiter(std::function< bool()> condition)
Construct with a condition predicate.
bool await_ready() const
Evaluate the condition before suspending.
Suspends a FreeRoutine until a caller-supplied predicate returns true.