Template Function exathread::yieldUntilComplete(const MultiFuture<T>&)

Function Documentation

template<typename T>
details::YieldOp exathread::yieldUntilComplete(const MultiFuture<T> &futures)

Suspend execution of your task and allow other tasks to run until futures resolve.

Note

As the use of this function makes your function a coroutine, it must explicitly return either a VoidTask or ValueTask and use co_return to be valid

Parameters:

futures – The futures of which to yield until completion. It is not guaranteed that execution will resume exactly when the futures become complete.

Throws:

std::logic_error – If the specified futures have already been completed

Returns:

An awaitable object; you must use co_await on this result to yield correctly