std1.0.0-beta-7 SafeC docs

std :: async::executor

Struct std::FnPark

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

struct FnPark {
    fn long long() now_fn;
    fn void(long long) idle_fn;
    ?&int flag;
}

A Park from functions: now() for the clock, idle(timeout_ms) to wait (WFI on bare metal; timeout -1 = until an interrupt), wake() (or null) from another context to end idle() early.

Fields

§fn long long() now_fnsource
§fn void(long long) idle_fnsource
§?&int flagsource

unused by FnPark itself; for the caller's idle_fn

Methods

§static struct FnPark new(fn long long() now, fn void(long long) idle)source · definition
§long long now_ms()source · definition
§void park(long long timeout_ms)source · definition
§void unpark()source · definition