27typedef struct xtc_notify xtc_notify_t;
35int xtc_notify_create(xtc_notify_t **out);
36void xtc_notify_destroy(xtc_notify_t *n);
41int xtc_notify_signal(xtc_notify_t *n);
46int xtc_notify_wait(xtc_notify_t *n, int64_t timeout_ns);
50typedef struct xtc_sem xtc_sem_t;
60int xtc_sem_create(
unsigned initial, xtc_sem_t **out);
61void xtc_sem_destroy(xtc_sem_t *s);
64int xtc_sem_post(xtc_sem_t *s,
unsigned n);
67int xtc_sem_acquire(xtc_sem_t *s,
unsigned n, int64_t timeout_ns);
70int xtc_sem_try_acquire(xtc_sem_t *s,
unsigned n);
72int xtc_sem_count(
const xtc_sem_t *s);
76typedef struct xtc_abort_source xtc_abort_source_t;
91int xtc_abort_source_create(xtc_abort_source_t **out);
92void xtc_abort_source_destroy(xtc_abort_source_t *s);
96int xtc_abort_source_fire(xtc_abort_source_t *s,
int reason);
99int xtc_abort_source_token(xtc_abort_source_t *s, xtc_abort_token_t *out);
106 xtc_abort_source_t *src;
109int xtc_abort_token_is_aborted(
const xtc_abort_token_t *t);
110int xtc_abort_token_reason(
const xtc_abort_token_t *t);
114typedef struct xtc_amutex xtc_amutex_t;
134int xtc_amutex_create(xtc_amutex_t **out);
145#define XTC_AMUTEX_RECURSIVE 0x1u
146int xtc_amutex_create_ex(xtc_amutex_t **out,
unsigned flags);
155#define XTC_AMUTEX_STATIC_MAX 32u
156xtc_amutex_t *xtc_amutex_static(
unsigned slot);
158void xtc_amutex_destroy(xtc_amutex_t *m);
159int xtc_amutex_lock(xtc_amutex_t *m, int64_t timeout_ns);
160int xtc_amutex_try_lock(xtc_amutex_t *m);
161int xtc_amutex_unlock(xtc_amutex_t *m);
165typedef struct xtc_arwlock xtc_arwlock_t;
184int xtc_arwlock_create(xtc_arwlock_t **out);
185void xtc_arwlock_destroy(xtc_arwlock_t *r);
186int xtc_arwlock_rdlock(xtc_arwlock_t *r, int64_t timeout_ns);
187int xtc_arwlock_wrlock(xtc_arwlock_t *r, int64_t timeout_ns);
188int xtc_arwlock_unlock(xtc_arwlock_t *r);
192typedef struct xtc_rwlock xtc_rwlock_t;
203int xtc_rwlock_create(xtc_rwlock_t **out);
204void xtc_rwlock_destroy(xtc_rwlock_t *r);
205int xtc_rwlock_rdlock(xtc_rwlock_t *r, int64_t timeout_ns);
206int xtc_rwlock_wrlock(xtc_rwlock_t *r, int64_t timeout_ns);
207int xtc_rwlock_unlock(xtc_rwlock_t *r);
211typedef struct xtc_barrier xtc_barrier_t;
221int xtc_barrier_create(
unsigned n, xtc_barrier_t **out);
222void xtc_barrier_destroy(xtc_barrier_t *b);
223int xtc_barrier_wait(xtc_barrier_t *b);
227typedef struct xtc_gate xtc_gate_t;
250int xtc_gate_create(xtc_gate_t **out);
251void xtc_gate_destroy(xtc_gate_t *g);
252int xtc_gate_enter(xtc_gate_t *g);
253int xtc_gate_leave(xtc_gate_t *g);
254int xtc_gate_close(xtc_gate_t *g);
255int xtc_gate_drain(xtc_gate_t *g, int64_t timeout_ns);
256int xtc_gate_count(
const xtc_gate_t *g);