void(* sys_runloop_init_func_t)(uint8_t worker_index)
Per-worker initialisation callback.
uint32_t sys_runloop_run(uint8_t num_workers, sys_event_queue_t *queue, sys_runloop_init_func_t init_fn, sys_runloop_event_func_t event_fn, sys_runloop_poll_func_t poll_fn, sys_runloop_exit_func_t exit_fn)
Start the run loop and block until shutdown.
void(* sys_runloop_exit_func_t)(uint8_t worker_index)
Per-worker exit callback.
bool sys_runloop_post(sys_event_t event)
Post an event to be processed by the run loop.
void(* sys_runloop_event_func_t)(sys_event_t event)
Event handler called on a worker for each posted event.
void(* sys_runloop_poll_func_t)(void)
Optional periodic poll callback invoked by worker 0.
struct sys_event_queue_t sys_event_queue_t
Opaque event queue.
Defines opaque event queues for producer/consumer coordination.
void * sys_event_t
Event payload stored in a queue.
void sys_runloop_shutdown(uint32_t exit_value)
Signal the run loop to stop accepting events and exit when drained.