C/C++ API Reference
Loading...
Searching...
No Matches
Context

Overview

Resources for scheduling asynchronous work.

Classes

class  pw::async2::Context
 

Functions

PendingType pw::async2::Context::Unschedule ()
 
void pw::async2::Context::ReEnqueue ()
 

Function Documentation

◆ 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:

Waker waker;
PW_ASYNC_STORE_WAKER(cx, waker, ...);
waker.Wake();
Definition: waker.h:155
#define PW_ASYNC_STORE_WAKER(context, waker_out, wait_reason_string)
Definition: waker.h:64

◆ Unschedule()

PendingType pw::async2::Context::Unschedule ( )
inline

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.