Joining Threads When we want to join to a join-able thread, we use the "thread_join" function. Assume 'thr' is a handle (pthread_t) of a join-able thread. void* thr_exit_status; /* as returned by the exiting thread. */ if (pthread_join(&thr, &thr_exit_status) != 0) { /* handle error.. */ } If the thread is not in a join-able thread, "pthread_join" would return a non-zero value, and 'errno' will be set to EINVAL.