DDraceNetwork Documentation
Loading...
Searching...
No Matches
Threading

Functions

void * thread_init (void(*threadfunc)(void *), void *user, const char *name)
void thread_wait (void *thread)
void thread_yield ()
void thread_detach (void *thread)
void thread_init_and_detach (void(*threadfunc)(void *), void *user, const char *name)

Detailed Description

Threading related functions.

See also
Locks
Semaphores

Function Documentation

◆ thread_detach()

void thread_detach ( void * thread)

Puts the thread in the detached state, guaranteeing that resources of the thread will be freed immediately when the thread terminates.

Parameters
threadThread to detach.

◆ thread_init()

void * thread_init ( void(* threadfunc )(void *),
void * user,
const char * name )

Creates a new thread.

Parameters
threadfuncEntry point for the new thread.
userPointer to pass to the thread.
nameName describing the use of the thread.
Returns
Handle for the new thread.

◆ thread_init_and_detach()

void thread_init_and_detach ( void(* threadfunc )(void *),
void * user,
const char * name )

Creates a new thread and detaches it.

Parameters
threadfuncEntry point for the new thread.
userPointer to pass to the thread.
nameName describing the use of the thread.

◆ thread_wait()

void thread_wait ( void * thread)

Waits for a thread to be done or destroyed.

Parameters
threadThread to wait for.

◆ thread_yield()

void thread_yield ( )

Yield the current thread's execution slice.