pthread_join(3T)														  pthread_join(3T)

NAME
pthread_join() - wait for the termination of a specified thread SYNOPSIS
PARAMETERS
thread Thread whose termination is awaited by the caller. value_ptr Pointer to the location where the exit status of thread is returned. DESCRIPTION
The function waits for the termination of the target thread. If the target thread has already terminated, this function returns immedi- ately. Only threads created with a detachstate attribute value of may be specified in the target thread parameter. On successful return from the value_ptr argument, if it is not a null pointer, will contain the value passed to by the terminating thread. When a call returns successfully, the caller is guaranteed the target thread has terminated. If more than one thread calls for the same target thread, one thread is guaranteed to return successfully. Undefined behavior results for other callers specifying the same thread. If the thread calling is canceled, the target thread shall not be joined. The exit status of the target thread will remain available for another thread to call If the target thread was canceled, its exit status is It is unspecified whether a thread that has exited, but remains unjoined, counts against the limit. RETURN VALUE
Upon successful completion, returns zero. Otherwise, an error number is returned to indicate the error (the variable is not set). ERRORS
If any of the following occur, the function returns the corresponding error number: [EINVAL] The value specified by thread does not refer to a joinable thread. [ESRCH] No thread could be found corresponding to thread. For each of the following conditions, if the condition is detected, the function returns the corresponding error number: [EDEADLK] This operation would result in process deadlock or thread specifies the calling thread. AUTHOR
was derived from the IEEE POSIX P1003.1c standard. SEE ALSO
pthread_create(3T), wait(2). STANDARDS CONFORMANCE
Pthread Library pthread_join(3T)