Loading...
Searching...
No Matches
async_context_poll

async_context_poll provides an implementation of async_context that is intended for use with a simple polling loop on one core. It is not thread safe. More...

Data Structures

struct  async_context_poll
 Async context type for a simple single-core polling loop. More...
 

Typedefs

typedef struct async_context_poll async_context_poll_t
 Async context type for a simple single-core polling loop.
 

Functions

bool async_context_poll_init_with_defaults (async_context_poll_t *self)
 Initialize an async_context_poll instance with default values.
 

Detailed Description

async_context_poll provides an implementation of async_context that is intended for use with a simple polling loop on one core. It is not thread safe.

The async_context_poll method must be called periodically to handle asynchronous work that may now be pending. async_context_wait_for_work_until() may be used to block a polling loop until there is work to do, and prevent tight spinning.

Typedef Documentation

◆ async_context_poll_t

Async context type for a simple single-core polling loop.

Holds the state for an async_context_poll instance, which processes asynchronous work by polling rather than using interrupts or threads.

Function Documentation

◆ async_context_poll_init_with_defaults()

bool async_context_poll_init_with_defaults ( async_context_poll_t self)

Initialize an async_context_poll instance with default values.

If this method succeeds (returns true), then the async_context is available for use and can be de-initialized by calling async_context_deinit().

Parameters
selfa pointer to async_context_poll structure to initialize
Returns
true if initialization is successful, false otherwise