NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES
$(OS_DIR)/lib/libpthreads.a #include <pthread.h>int pthread_join(pthread_t thread, void **status);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
The pthread_join() function suspends execution of the calling thread, until the target thread terminates (unless thread has already terminated). On return from a successful pthread_join() with a non-NULL status argument, the value passed to pthread_exit() by the terminating thread is made available in the location referenced by status. When pthread_join() returns, the target thread has been terminated and its associated resources freed.
The pthread_join() function may be used on any target thread created with the detachstate attribute set to PTHREAD_CREATE_JOINABLE (the default). If the thread argument designates a thread created in the PTHREAD_CREATE_DETACHED state, pthread_join() returns immediately with an error. A joinable thread may only be subject to one outstanding pthread_join(). A subsequent call to pthread_join() while the first is still pending, will return an error. The function may not return immediately. However, if a thread blocked in pthread_join() is aborted, the target thread remains joinable by a subsequent pthread_join().
A joinable thread that has exited but remains unjoined counts against the PTHREAD_THREADS_MAX total, as system resources remain allocated on its behalf.
On successful completion, pthread_join() returns a value of zero. Otherwise, an error code is returned.
Note: This call does not set errno.
The thread argument is not a valid thread identifier. The thread argument identifies a thread created in the PTHREAD_CREATE_DETACHED mode.
No thread corresponding to the identifier thread was found. Another pthread_join() call is already pending for the thread identified by thread.
pthread_join() was interrupted by a thread abort.
The thread argument identifies the calling thread.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES