std :: async::future
Struct std::WaitList
struct WaitList {
struct Waker w[ASYNC_WAITERS];
int serial[ASYNC_WAITERS];
int count;
int next_serial;
}Fields
0 = free, else the registration's serial
Methods
Register (or, with the id of a live registration, refresh) a waiter. Returns its id, 0 if full.
Remove a registration (a stale or 0 id is ignored).
Whether 'id' is still registered (not woken or removed yet).
Wake (and remove) one waiter. Returns 1 if there was one.
Wake (and remove) every waiter. Returns how many.
Releases every registered waker (without waking it). A WaitList owns the waker clones registered in it, so whatever holds one (a mutex, a channel, a timer queue) drops it.