next up previous contents index
Next: 18.3.29 pthread_key_create: Create a Up: 18.3 POSIX Threads Reference Previous: 18.3.27 pthread_exit: Terminate a

18.3.28 pthread_join: Join with a target thread

 

SYNOPSIS

#include <oskit/threads/pthread.h>

int pthread_join(pthread_t tid, void **status);

DESCRIPTION

The current thread indicates that it would like to join with the target thread specified by tid. If the target thread has already terminated, its exit status is provided immediately to the caller. If the target thread has not yet exited, the caller is made to wait. Once the target has exited, all of the threads waiting to join with it are woken up, and the target's exit status provided to each.

PARAMETERS

tid
The thread id of the thread being joined with.
status
A pointer to a location where the target's exit status is placed.

RETURNS

Returns zero on success, storing the target's exit status in *status. EINVAL if tid refers to a non-existent thread.

RELATED INFORMATION

pthread_join, pthread_create, pthread_detach



University of Utah Flux Research Group