Lely core libraries
2.2.5
|
Go to the documentation of this file.
33 #ifndef LELY_UTIL_FIBER_H_
34 #define LELY_UTIL_FIBER_H_
47 #define FIBER_SAVE_MASK 0x1
52 #define FIBER_SAVE_FENV 0x2
58 #define FIBER_SAVE_ERROR 0x4
64 #if _POSIX_C_SOURCE >= 200112L
65 #define FIBER_SAVE_ALL (FIBER_SAVE_MASK | FIBER_SAVE_FENV | FIBER_SAVE_ERROR)
67 #define FIBER_SAVE_ALL (FIBER_SAVE_FENV | FIBER_SAVE_ERROR)
77 #define FIBER_GUARD_STACK 0x8
143 size_t data_size,
size_t stack_size);
187 #endif // !LELY_UTIL_FIBER_H_
fiber_t * fiber_create(fiber_func_t *func, void *arg, int flags, size_t data_size, size_t stack_size)
Creates a new fiber, allocates a stack and sets up a calling environment to begin executing the speci...
void * fiber_data(const fiber_t *fiber)
Returns a pointer to the data region of the specified fiber, or of the calling fiber if fiber is NULL...
void fiber_destroy(fiber_t *fiber)
Destroys the specified fiber.
void fiber_thrd_fini(void)
Finalizes the fiber associated with the calling thread.
fiber_t * fiber_resume(fiber_t *fiber)
Equivalent to fiber_resume_with(fiber, NULL, NULL).
fiber_t * fiber_func_t(fiber_t *fiber, void *arg)
The type of the function executed by a fiber.
fiber_t * fiber_resume_with(fiber_t *fiber, fiber_func_t *func, void *arg)
Suspends the calling fiber and resumes the specified fiber, optionally executing a function before re...
int fiber_thrd_init(int flags)
Initializes the fiber associated with the calling thread.