31typedef int (*xtc_task_fn)(xtc_task_t *self,
void *user);
33#define XTC_TASK_DONE 0
34#define XTC_TASK_RESCHED 1
35#define XTC_TASK_PENDING 2
42typedef struct xtc_waker {
48typedef void (*xtc_timer_fn)(
void *user);
66int xtc_loop_init(xtc_loop_t **out);
67int xtc_loop_fini(xtc_loop_t *loop);
68int xtc_loop_run(xtc_loop_t *loop);
69int xtc_loop_stop(xtc_loop_t *loop);
79struct xtc_res *xtc_loop_res(xtc_loop_t *loop);
81int xtc_task_spawn(xtc_loop_t *loop, xtc_task_fn fn,
void *user,
82 xtc_task_t **out_task);
83int xtc_task_waker(xtc_task_t *task,
xtc_waker_t *out);
89int xtc_task_park_on_timer(xtc_task_t *self, int64_t delay_ns);
100int xtc_task_park_on_fd(xtc_task_t *self,
int fd, uint32_t interest);
104int xtc_timer_set(xtc_loop_t *loop, int64_t delay_ns,
105 xtc_timer_fn fn,
void *user, xtc_timer_t **out_timer);
106int xtc_timer_cancel(xtc_timer_t *timer);