A scope created, joined once, and destroyed by a coroutine. Its scheduler must outlive it. Keep the coroutine frame alive until its join resumes. On an adopted thread, a submission to an asynchronous scope older than the innermost live synchronous scope fails a release assertion. A younger asynchronous scope may submit. When the target has a slot owned by this caller, its queued work goes to the global queue while the synchronous scope is live.
More...
#include "donner/base/tasks/AsyncTaskScope.h"
|
| class | JoinAwaitable |
| | The waiting coroutine owns its queue entry until the scheduler resumes it. More...
|
|
| | AsyncTaskScope (TaskScheduler &scheduler) |
|
| AsyncTaskScope (const AsyncTaskScope &)=delete |
|
| AsyncTaskScope (AsyncTaskScope &&)=delete |
|
AsyncTaskScope & | operator= (const AsyncTaskScope &)=delete |
|
AsyncTaskScope & | operator= (AsyncTaskScope &&)=delete |
|
template<typename F> |
| void | spawn (F &&work) |
| | Spawns from the creator before join, or from a task of this scope while it is still running. Runs inline if the scheduler has no capacity.
|
|
template<typename F> |
| bool | trySpawn (F &&work) |
| | Returns false and leaves the callable with the caller at a bound.
|
|
JoinAwaitable | join () noexcept |
| | Joins after outstanding work finishes. An empty scope completes synchronously.
|
|
|
class | TaskScheduler |
|
class | AsyncTaskScopeTestPeer |
A scope created, joined once, and destroyed by a coroutine. Its scheduler must outlive it. Keep the coroutine frame alive until its join resumes. On an adopted thread, a submission to an asynchronous scope older than the innermost live synchronous scope fails a release assertion. A younger asynchronous scope may submit. When the target has a slot owned by this caller, its queued work goes to the global queue while the synchronous scope is live.
◆ AsyncTaskScope()
| donner::tasks::AsyncTaskScope::AsyncTaskScope |
( |
TaskScheduler & | scheduler | ) |
|
|
explicit |
- Parameters
-
| scheduler | Runs the scope's tasks and queues its continuation. |
The documentation for this class was generated from the following file: