Crate nstd_thread

Source

Functions§

nstd_thread_detach
Detaches the given thread. Will set the thread handle to NSTDC_NULL. Parameters: void **handle - The handle to the thread.
nstd_thread_join
Joins the given thread. Will set the thread handle to NSTDC_NULL. Parameters: void **handle - The handle to the thread. Returns: int ret - The value that the thread returns with.
nstd_thread_sleep
Sleeps the current thread for secs seconds. Parameters: const double secs - Number of seconds to sleep for.
nstd_thread_spawn
Spawns a new thread. Failure to call nstd_thread_join or nstd_thread_detach will result in a memory leak. Parameters: int(*thread_fn)() - The function to be spawned as a new thread. Returns: void *handle - The handle to the thread.
nstd_thread_yield
Yields the current thread allowing other threads to have more CPU time.

Type Aliases§

NSTDThreadHandle
Represents a thread handle