Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
Loading...
Searching...
No Matches
aria::async::WhenAllAwaiter< Ts > Class Template Reference

Awaitable that resolves when ALL input Tasks complete. More...

#include <when_all.hpp>

Public Types

using Result = std::tuple<Ts...>

Public Member Functions

 WhenAllAwaiter (Task< Ts >... ts)
bool await_ready () const noexcept
void await_suspend (std::coroutine_handle<> caller)
Result await_resume ()

Detailed Description

template<typename... Ts>
class aria::async::WhenAllAwaiter< Ts >

Awaitable that resolves when ALL input Tasks complete.

Returns std::tuple<T1, T2, ...>.

Race contract: await_suspend publishes parent_->store(caller) (release) BEFORE spawning any driver coroutine. Drivers read parent_->load() (acquire) only after the remaining_ atomic counter hits zero — so a synchronously-completing task that drives remaining_ to zero inside its own start_detached() call still observes the published handle. The handle is held in an atomic (WhenAllParentHandle), so this is TSan-clean and does not depend on statement ordering for correctness; the store-before-spawn ordering is kept only as a performance optimisation (avoids a redundant re-check).

Member Typedef Documentation

◆ Result

template<typename... Ts>
using aria::async::WhenAllAwaiter< Ts >::Result = std::tuple<Ts...>

Constructor & Destructor Documentation

◆ WhenAllAwaiter()

template<typename... Ts>
aria::async::WhenAllAwaiter< Ts >::WhenAllAwaiter ( Task< Ts >... ts)
inlineexplicit

Member Function Documentation

◆ await_ready()

template<typename... Ts>
bool aria::async::WhenAllAwaiter< Ts >::await_ready ( ) const
inlinenoexcept

◆ await_suspend()

template<typename... Ts>
void aria::async::WhenAllAwaiter< Ts >::await_suspend ( std::coroutine_handle<> caller)
inline

◆ await_resume()

template<typename... Ts>
Result aria::async::WhenAllAwaiter< Ts >::await_resume ( )
inline

The documentation for this class was generated from the following file: