Updated: April 19, 2023 |
Join thread
#include <threads.h> int thrd_join( thrd_t thr, int *const res );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The thrd_join() function blocks the calling thread until the target thread thr terminates, unless thr has already terminated. If res is non-NULL and thrd_join() returns successfully, then the value passed to thrd_exit() by the target thread is placed in res.
The target thread must be joinable. Multiple thrd_join(), pthread_join(), pthread_timedjoin(), ThreadJoin(), and ThreadJoin_r() calls on the same target thread aren't allowed. When thrd_join() returns successfully, the target thread has been terminated.
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |