.TH PTHREAD_EXIT 3 LinuxThreads
.SH NAME
pthread_exit \- terminate the calling thread
.SH SYNOPSIS
.B #include
.BI "void pthread_exit(void *" retval ");"
.SH DESCRIPTION
.B "pthread_exit"
terminates the execution of the calling thread.
All cleanup handlers that have been set for the calling thread with
.BR "pthread_cleanup_push" (3)
are executed in reverse order (the most
recently pushed handler is executed first). Finalization functions for
thread-specific data are then called for all keys that have non-
.B "NULL"
values associated with them in the calling thread (see
.BR "pthread_key_create" (3)).
Finally, execution of the calling thread is
stopped.
The
.I "retval"
argument is the return value of the thread. It can be
consulted from another thread using
.BR "pthread_join" (3).
.SH "RETURN VALUE"
The
.B "pthread_exit"
function never returns.
.SH AUTHOR
Xavier Leroy
.SH "SEE ALSO"
.BR "pthread_create" (3),
.BR "pthread_join" (3).
www.fiveanddime.net