cf_thread_create¶
Category: multithreading
GitHub: cute_multithreading.h
Creates a new thread and runs its thread function (CF_ThreadFn).
| Parameters | Description |
|---|---|
func |
The function to run for the thread. |
name |
The name of this thread. Must be unique. |
udata |
Can be NULL. This gets handed back to you in your func. |
Return Value¶
Returns an opaque pointer to CF_Thread.
Code Example¶
Example syntax of a thread.
Remarks¶
Unless you call cf_thread_detach you should call cf_thread_wait from another thread to clean up resources and get the thread's return value back. It is considered a leak otherwise.
Related Pages¶
CF_Thread
CF_ThreadFn
cf_thread_wait
cf_thread_detach
cf_thread_get_id
cf_thread_id