KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
kthread_worker_t Struct Reference

Opaque structure describing one worker thread. More...

#include <worker_thread.h>

Related Symbols

(Note that these are not member symbols.)

kthread_worker_tthd_worker_create_ex (const kthread_attr_t *attr, void(*routine)(void *), void *data)
 Create a new worker thread with the specific set of attributes.
 
static kthread_worker_tthd_worker_create (void(*routine)(void *), void *data)
 Create a new worker thread.
 
void thd_worker_destroy (kthread_worker_t *thd)
 Stop and destroy a worker thread.
 
void thd_worker_wakeup (kthread_worker_t *thd)
 Wake up a worker thread.
 
kthread_tthd_worker_get_thread (kthread_worker_t *thd)
 Get a handle to the underlying thread.
 

Detailed Description

Opaque structure describing one worker thread.

Friends And Related Symbol Documentation

◆ thd_worker_create()

static kthread_worker_t * thd_worker_create ( void(* routine )(void *),
void * data )
related

Create a new worker thread.

This function will create a thread with the default attributes that will call the given routine with the given param pointer when notified. The thread will only stop when thd_worker_destroy() is called.

Parameters
routineThe function to call in the worker thread.
dataA parameter to pass to the function called.
Returns
The new worker thread on success, NULL on failure.
See also
thd_worker_destroy, thd_worker_wakeup

References data, NULL, and thd_worker_create_ex().

◆ thd_worker_create_ex()

kthread_worker_t * thd_worker_create_ex ( const kthread_attr_t * attr,
void(* routine )(void *),
void * data )
related

Create a new worker thread with the specific set of attributes.

This function will create a thread with the specified attributes that will call the given routine with the given param pointer when notified. The thread will only stop when thd_worker_destroy() is called.

Parameters
attrA set of thread attributes for the created thread. Passing NULL will initialize all attributes to their default values.
routineThe function to call in the worker thread.
dataA parameter to pass to the function called.
Returns
The new worker thread on success, NULL on failure.
See also
thd_worker_destroy, thd_worker_wakeup

◆ thd_worker_destroy()

void thd_worker_destroy ( kthread_worker_t * thd)
related

Stop and destroy a worker thread.

This function will stop the worker thread and free its memory.

Parameters
thdThe worker thread to destroy.
See also
thd_worker_create, thd_worker_wakeup

◆ thd_worker_get_thread()

kthread_t * thd_worker_get_thread ( kthread_worker_t * thd)
related

Get a handle to the underlying thread.

Parameters
thdThe worker thread whose handle should be returned.
Returns
A handle to the underlying thread.

◆ thd_worker_wakeup()

void thd_worker_wakeup ( kthread_worker_t * thd)
related

Wake up a worker thread.

This function will wake up the worker thread, causing it to call its corresponding work function.

Parameters
thdThe worker thread to wake up.
See also
thd_worker_create, thd_worker_destroy

The documentation for this struct was generated from the following file: