v2.0.0
Data Fields
async_when_pending_worker Struct Reference
High Level APIs » pico_async_context

A "worker" instance used by an async_context. More...

`#include <async_context.h>`

Collaboration diagram for async_when_pending_worker:
[legend]

## Data Fields
struct async_when_pending_worker * | next
| private link list pointer
void(* | do_work )(async_context_t *context, struct async_when_pending_worker *worker)
| Called by the async_context when the worker has been marked as having "work pending". More...
bool | work_pending
| True if the worker need do_work called.
void * | user_data
| User data associated with the worker instance.

## Detailed Description

A "worker" instance used by an async_context.

A "worker" represents some external entity that must do work in response to some external stimulus (usually an IRQ). Its methods are called from the async_context under lock at the given time

See also
  async_context_add_worker_at
  async_context_add_worker_in_ms

## Field Documentation

## ◆ do_work

void(* async_when_pending_worker::do_work) (async_context_t *context, struct async_when_pending_worker *worker)

Called by the async_context when the worker has been marked as having "work pending".

Parameters

  context | the async_context
  worker | the function to be called when work is pending

The documentation for this struct was generated from the following file:

- include/pico/async_context.h