Kore
Loading...
Searching...
No Matches
fiber.h File Reference

The fiber-API is experimental and only supported on a few system. More...

#include <kinc/global.h>
#include <kinc/backend/fiber.h>

Go to the source code of this file.

Data Structures

struct  kinc_fiber

Typedefs

typedef struct kinc_fiber kinc_fiber_t

Functions

KINC_FUNC void kinc_fiber_init_current_thread (kinc_fiber_t *fiber)
 Uses the current thread as a fiber.
KINC_FUNC void kinc_fiber_init (kinc_fiber_t *fiber, void(*func)(void *param), void *param)
 Initializes a fiber.
KINC_FUNC void kinc_fiber_destroy (kinc_fiber_t *fiber)
 Destroys a fiber.
KINC_FUNC void kinc_fiber_switch (kinc_fiber_t *fiber)
 Switch the current thread to a different fiber.

Detailed Description

The fiber-API is experimental and only supported on a few system.

Function Documentation

◆ kinc_fiber_destroy()

KINC_FUNC void kinc_fiber_destroy ( kinc_fiber_t * fiber)

Destroys a fiber.

Parameters
fiberThe fiber to destroy

◆ kinc_fiber_init()

KINC_FUNC void kinc_fiber_init ( kinc_fiber_t * fiber,
void(* func )(void *param),
void * param )

Initializes a fiber.

Parameters
fiberThe fiber-object to initialize
funcThe function to be run in the fiber-context
paramA parameter to be provided to the fiber-function when it starts running

◆ kinc_fiber_init_current_thread()

KINC_FUNC void kinc_fiber_init_current_thread ( kinc_fiber_t * fiber)

Uses the current thread as a fiber.

Parameters
fiberThe fiber-object to initialize using the current thread

◆ kinc_fiber_switch()

KINC_FUNC void kinc_fiber_switch ( kinc_fiber_t * fiber)

Switch the current thread to a different fiber.

Parameters
fiberThe fiber to switch to