|
int | zth_fiber_create (void(*f)(void *), void *arg=nullptr, size_t stack=0, char const *name=nullptr) noexcept |
| Run a function as a new fiber. More...
|
|
void * | zth_fls () noexcept |
| Return the fiber-local storage, as set by setFls(). More...
|
|
void | zth_setFls (void *data=nullptr) noexcept |
| Set the fiber-local storage. More...
|
|
void | zth_nap (struct timespec const *ts) |
| Sleep for the given time interval. More...
|
|
void | zth_mnap (long sleepFor_ms) |
| Sleep for the given amount of milliseconds. More...
|
|
void | zth_unap (long sleepFor_us) |
| Sleep for the given amount of microseconds. More...
|
|
void | zth_yield () noexcept |
| Allow a context switch. More...
|
|
void | zth_outOfWork () noexcept |
| Force a context switch. More...
|
|
int | zth_worker_create () noexcept |
| Create a Worker. More...
|
|
void | zth_worker_run (struct timespec const *ts=nullptr) noexcept |
| Run the worker for the given amount of time. More...
|
|
void | zth_worker_destroy () noexcept |
| Cleanup the worker. More...
|
|
int | zth_startWorkerThread (void(*f)(), size_t stack=0, char const *name=nullptr) noexcept |
| Start a new thread, create a Worker, with one fiber, which executes f . More...
|
|
int | zth_execvp (char const *file, char *const arg[]) noexcept |
| Start an external program. More...
|
|
Force a context switch.
Normally, yield() does not yield when the time slice did not end. This prevents excessive context switching, without actually doing much work in between. However, if there is no work, this function forces a context switch anyway.
This is a C-wrapper for zth::outOfWork().
Definition at line 498 of file worker.h.