Updated: April 19, 2023 |
Create a thread
#include <threads.h> typedef int (*thrd_start_t)(void*); int thrd_create( thrd_t *thr, thrd_start_t func, void *arg );
The thread in which main() was invoked behaves differently. When it returns from main(), there's an implicit call to exit(), using the return value of main() as the exit status.
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The thrd_create() function creates a new thread. The created thread inherits the signal mask of the parent thread, and its set of pending signals is empty.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |