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

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

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

Go to the source code of this file.

Data Structures

struct  kore_fiber

Typedefs

typedef struct kore_fiber kore_fiber

Functions

KORE_FUNC void kore_fiber_init_current_thread (kore_fiber *fiber)
 Uses the current thread as a fiber.
KORE_FUNC void kore_fiber_init (kore_fiber *fiber, void(*func)(void *param), void *param)
 Initializes a fiber.
KORE_FUNC void kore_fiber_destroy (kore_fiber *fiber)
 Destroys a fiber.
KORE_FUNC void kore_fiber_switch (kore_fiber *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

◆ kore_fiber_destroy()

KORE_FUNC void kore_fiber_destroy ( kore_fiber * fiber)

Destroys a fiber.

Parameters
fiberThe fiber to destroy

◆ kore_fiber_init()

KORE_FUNC void kore_fiber_init ( kore_fiber * 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

◆ kore_fiber_init_current_thread()

KORE_FUNC void kore_fiber_init_current_thread ( kore_fiber * fiber)

Uses the current thread as a fiber.

Parameters
fiberThe fiber-object to initialize using the current thread

◆ kore_fiber_switch()

KORE_FUNC void kore_fiber_switch ( kore_fiber * fiber)

Switch the current thread to a different fiber.

Parameters
fiberThe fiber to switch to