37 #ifndef LELY_EV_CO_FIBER_H_ 38 #define LELY_EV_CO_FIBER_H_ 132 void *ev_fiber_exec_alloc(
void);
133 void ev_fiber_exec_free(
void *ptr);
135 void ev_fiber_exec_fini(
ev_exec_t *exec);
291 #endif // !LELY_EV_CO_FIBER_H_ void ev_fiber_cnd_destroy(ev_fiber_cnd_t *cond)
Releases all resources used by the fiber condition variable at cond.
This header file is part of the utilities library; it contains the fiber declarations.
const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
Indicates that the requested operation succeeded.
int ev_fiber_cnd_signal(ev_fiber_cnd_t *cond)
Unblocks one of the fibers that are blocked on the fiber condition variable at cond at the time of th...
int ev_fiber_thrd_init(int flags, size_t stack_size, size_t max_unused)
Initializes the calling thread for use by fiber executors.
Indicates that the requested operation failed because a resource requested by a test and return funct...
int ev_fiber_mtx_trylock(ev_fiber_mtx_t *mtx)
Endeavors to lock the fiber mutex at mtx.
A synchronization primitive (similar to the standard C11 condition variable) that can be used to bloc...
A synchronization primitive (similar to the standard C11 mutex) that can be used to protect shared da...
int ev_fiber_cnd_init(ev_fiber_cnd_t *cond)
Creates a fiber condition variable.
A fiber mutex type that supports neither timeout nor recursive locking.
int ev_fiber_cnd_broadcast(ev_fiber_cnd_t *cond)
Unblocks all of the fibers that are blocked on the fiber condition variable at cond at the time of th...
int ev_fiber_cnd_wait(ev_fiber_cnd_t *cond, ev_fiber_mtx_t *mtx)
Atomically unlocks the fiber mutex at mtx and endeavors to block until the fiber condition variable a...
Indicates that the requested operation failed.
void ev_fiber_thrd_fini(void)
Finalizes the calling thread and prevents further use by fiber executors.
int ev_fiber_mtx_unlock(ev_fiber_mtx_t *mtx)
Unlocks the fiber mutex at mtx.
ev_exec_t * ev_fiber_exec_create(ev_exec_t *inner_exec)
Creates a fiber executor.
This header file is part of the event library; it contains the futures and promises declarations...
Indicates that the requested operation failed because it was unable to allocate memory.
A fiber mutex type that supports timeout (currently not supported).
void ev_fiber_exec_destroy(ev_exec_t *exec)
Destroys a fiber executor.
Indicates that the time specified in the call was reached without acquiring the requested resource...
ev_exec_t * ev_fiber_exec_get_inner_exec(const ev_exec_t *exec)
Returns a pointer to the inner executor of a fiber executor.
int ev_fiber_mtx_init(ev_fiber_mtx_t *mtx, int type)
Creates a fiber mutex object with properties indicated by type, which must have one of the four value...
A fiber mutex type that supports recursive locking.
void ev_fiber_mtx_destroy(ev_fiber_mtx_t *mtx)
Releases any resources used by the fiber mutex at mtx.
void ev_fiber_await(ev_future_t *future)
Suspends a currently running fiber until the specified future becomes ready (or is cancelled)...
int ev_fiber_mtx_lock(ev_fiber_mtx_t *mtx)
Suspends the currently running fiber until it locks the fiber mutex at mtx.