Resources for scheduling asynchronous work.
◆ IsRunningOn()
| bool pw::async2::Context::IsRunningOn |
( |
const Dispatcher & |
dispatcher | ) |
const |
|
inline |
Returns whether the provided dispatcher is the dispatcher running the task.
This is helpful for subsystems that require their components to run on a single dispatcher. Futures can verify that they are only being pended by the correct dispatcher.
◆ ReEnqueue()
| void pw::async2::Context::ReEnqueue |
( |
| ) |
|
|
inline |
Queues the current Task::Pend to run again in the future, possibly after other work is performed.
This may be used by Task implementations that wish to provide additional fairness by yielding to the dispatch loop rather than perform too much work in a single iteration.
This is semantically equivalent to calling:
#define PW_ASYNC_STORE_WAKER(context, waker_out, wait_reason_string)
Definition: waker.h:64
◆ Unschedule()
Indicates that the task has not completed, but that it also does not need to register a waker and go to sleep. This results in the task being removed from the dispatcher, requiring it to be manually re-posted to run again.