1#define _POSIX_C_SOURCE 200809L
22#define KQ_WAKE_IDENT 0
81 if (!q || !func)
return false;
132 for (
int i = 0;
i <
n;
i++) {
198 for (
int i = 0;
i <
n;
i++) {
Memory allocation wrappers backed by libttak.
void cwist_free(void *ptr)
Free memory obtained via cwist_alloc/cwist_strdup/etc.
void * cwist_alloc(size_t size)
Allocate zeroed memory tracked by libttak.
Platform Agnostic Async Job Queue Interface.
void(* cwist_job_func)(void *arg)
Job function signature.
struct cwist_io_queue cwist_io_queue
Opaque handle for the IO Queue. Backend implementation depends on OS (io_uring, kqueue,...
Epoch-based garbage collection wrapper.
bool cwist_gc_scope_disown(void *ptr)
Remove ptr from the current thread's pending-sweep list without freeing it, because ownership is bein...
bool cwist_full_gc_enabled(void)
Check whether full-GC mode is currently enabled.
void cwist_gc_scope_flush(void)
Retire every block still on the current thread's pending-sweep list right now, instead of waiting for...
void cwist_io_queue_run(cwist_io_queue *q)
Process queued jobs until shutdown is requested and no work remains.
void cwist_io_queue_stop(cwist_io_queue *q)
Request that runners stop without freeing the queue.
void cwist_io_queue_destroy(cwist_io_queue *q)
Free jobs nobody ran, close the kqueue descriptor, free the queue.
cwist_io_queue * cwist_io_queue_create(size_t capacity)
Allocate a kqueue-backed IO queue wrapper.
bool cwist_io_queue_submit(cwist_io_queue *q, cwist_job_func func, void *arg)
Enqueue one callback by triggering an EVFILT_USER event.