Zth (libzth)
|
#include <libzth/macros.h>
#include <libzth/context.h>
#include <libzth/context/context.h>
#include <libzth/worker.h>
Go to the source code of this file.
Namespaces | |
zth | |
Macros | |
#define | ZTH_STACK_WATERMARKER ((uint64_t)0x5a7468574de2889eULL) |
Functions | |
int | zth::context_init () noexcept |
One-time context mechanism initialization. More... | |
void | zth::context_deinit () noexcept |
Final cleanup. More... | |
int | zth::context_create (Context *&context, ContextAttr const &attr) noexcept |
Create a context. More... | |
void | zth::context_destroy (Context *context) noexcept |
Destroy and cleanup a context. More... | |
void | zth::context_switch (Context *from, Context *to) noexcept |
Perform context switch. More... | |
size_t | zth::context_stack_usage (Context *context) noexcept |
Return the high water mark of the stack of the given context. More... | |
void | context_entry (zth::Context *context) noexcept |
Entry point of the fiber. More... | |
void | zth::stack_watermark_init (void *stack, size_t size) noexcept |
Initialize the memory region for stack high water marking. More... | |
size_t | zth::stack_watermark_size (void *stack) noexcept |
Return the size of the given stack region. More... | |
size_t | zth::stack_watermark_maxused (void *stack) noexcept |
Return the high water mark of the stack. More... | |
size_t | zth::stack_watermark_remaining (void *stack) noexcept |
Return the remaining stack size that was never touched. More... | |
#define ZTH_STACK_WATERMARKER ((uint64_t)0x5a7468574de2889eULL) |
Definition at line 211 of file context.cpp.
|
noexcept |
Entry point of the fiber.
This function is called by the actual context switching mechanism. It will call the entry function, as specified by the Context's attributes during creation, which is zth::Fiber::fiberEntry() by default.
This function does not return. When the entry function returns, the context is considered dead, the Worker's scheduler is invoked, and the context is destroyed.
Definition at line 178 of file context.cpp.