|THRD_JOIN(3C)||Standard C Library Functions||THRD_JOIN(3C)|
thrd_join() function suspends the execution of the current thread and waits for the thread indicated by thrd to terminate and stores the exit status, as set by a call to thrd_exit(3C), for that thread in res, if res is non-null. The thrd argument must be a member of the current process and it cannot be detached. If thrd has already terminated and another caller has not called
thrd_join() then the exit status will be returned to the caller without blocking execution of the thread.
If multiple threads call
the same thread, then both will be suspended until that thread terminates;
however, only one thread will return successfully and obtain the actual
status and the other will instead return with an error.
thrd_join() function returns thrd_success and if res is a non-null pointer, it will be filled in with the exit status of thrd. If an error occurs, thrd_error will be returned.
|August 27, 2019||illumos|