28typedef intptr_t (*xtc_coro_fn)(
void *arg);
48int xtc_async(xtc_loop_t *loop, xtc_coro_fn fn,
void *arg,
49 xtc_task_t **out_task);
59int xtc_await(xtc_task_t *t, intptr_t *result);
79void xtc_yield_set_budget(xtc_loop_t *loop, int64_t budget_ns);
80int xtc_yield_check(
void);
81int xtc_yield_if_due(
void);
82uint64_t xtc_yield_due_count(
const xtc_loop_t *loop);
88size_t xtc_stack_size(
void);
89int xtc_set_stack_size(
size_t bytes);
117int xtc_stack_reclaim_enable(
size_t keep_bytes);
118void xtc_stack_reclaim_disable(
void);
119int xtc_stack_reclaim_enabled(
void);
120uint64_t xtc_stack_reclaim_count(
void);
132#define XTC_COOP_REGION
139typedef struct xtc_pt {
143#define XTC_PT_THREAD(...) char __VA_ARGS__
144#define XTC_PT_INIT(pt) ((pt)->lc = 0)
145#define XTC_PT_BEGIN(pt) switch ((pt)->lc) { case 0:
146#define XTC_PT_END(pt) } (pt)->lc = 0; return 2
147#define XTC_PT_YIELD(pt) do { \
148 (pt)->lc = __LINE__; return 0 ; \
149 case __LINE__:; } while (0)
150#define XTC_PT_WAIT_UNTIL(pt, c) do { \
151 (pt)->lc = __LINE__; case __LINE__: \
152 if (!(c)) return 0; } while (0)
155#define XTC_PT_YIELDED 0