std1.0.0-beta-7 SafeC docs

std :: async::future

Macro ASYNC_WAITERS

#include <std/async/future.h> source

#define ASYNC_WAITERS 32

A fixed set of registered wakers, for primitives several futures wait on at once (a channel's senders, a mutex's lockers). No heap: ASYNC_WAITERS slots. add() returns an id the future keeps and passes back to refresh or remove its registration; an id stays tied to its registration (a slot reused after a wake gets a new id), so a stale one is harmless. A waiter that finds the list full gets id 0 and must re-poll on its own (cx.wake_by_ref()) — slower, never wrong.