PTHREAD_JOIN(3) | Linux Programmer's Manual | PTHREAD_JOIN(3) |
NAME
pthread_join - join with a terminated threadSYNOPSIS
#include<pthread.h>
int pthread_join(pthread_t thread, void **retval);
Compile and link with -pthread.
DESCRIPTION
The pthread_join() function waits for the thread specified by thread to terminate. If that thread has already terminated, then pthread_join() returns immediately. The thread specified by thread must be joinable.RETURN VALUE
On success, pthread_join() returns 0; on error, it returns an error number.ERRORS
- EDEADLK
- A deadlock was detected (e.g., two threads tried to join with each other); or thread specifies the calling thread.
- EINVAL
- thread is not a joinable thread.
- EINVAL
- Another thread is already waiting to join with this thread.
- ESRCH
- No thread with the ID thread could be found.
CONFORMING TO
POSIX.1-2001.NOTES
After a successful call to pthread_join(), the caller is guaranteed that the target thread has terminated.EXAMPLE
See pthread_create(3).SEE ALSO
pthread_cancel(3), pthread_create(3), pthread_detach(3), pthread_exit(3), pthread_tryjoin_np(3), pthreads(7)COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.2008-11-27 | Linux |