#include <oskit/threads/pthread.h>int pthread_join(pthread_t tid, void **status);
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.
- 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 zero on success, storing the target's exit status in *status. EINVAL if tid refers to a non-existent thread.
pthread_join, pthread_create, pthread_detach