Threading related functions.
- See also
- Locks
-
Semaphore
◆ 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
-
◆ thread_init()
void * thread_init |
( |
void(*)(void *) |
threadfunc, |
|
|
void * |
user, |
|
|
const char * |
name |
|
) |
| |
Creates a new thread.
- Parameters
-
threadfunc | Entry point for the new thread. |
user | Pointer to pass to the thread. |
name | Name describing the use of the thread. |
- Returns
- Handle for the new thread.
◆ thread_init_and_detach()
void thread_init_and_detach |
( |
void(*)(void *) |
threadfunc, |
|
|
void * |
user, |
|
|
const char * |
name |
|
) |
| |
Creates a new thread and detaches it.
- Parameters
-
threadfunc | Entry point for the new thread. |
user | Pointer to pass to the thread. |
name | Name describing the use of the thread. |
◆ thread_wait()
void thread_wait |
( |
void * |
thread | ) |
|
Waits for a thread to be done or destroyed.
- Parameters
-
thread | Thread to wait for. |
◆ thread_yield()
Yield the current thread's execution slice.