63 lines
1.3 KiB
Plaintext
63 lines
1.3 KiB
Plaintext
'\"macro stdmacro
|
|
.\"
|
|
.\" ----------------
|
|
.TH pthread_exit 3P
|
|
.\"
|
|
.\" ----------------
|
|
.SH NAME
|
|
pthread_exit \- terminate the calling thread
|
|
.\"
|
|
.\" ----------------
|
|
.Op c p a
|
|
.SH C SYNOPSIS
|
|
.nf
|
|
.ft 3
|
|
#include <pthread.h>
|
|
.sp .8v
|
|
void pthread_exit(void \(**retval);
|
|
.ft 1
|
|
.fi
|
|
.Op
|
|
.\"
|
|
.\" ----------------
|
|
.SH DESCRIPTION
|
|
The
|
|
.IR pthread_exit ()
|
|
function terminates the calling thread.
|
|
If the thread is not detached, then the value
|
|
.I retval
|
|
may be retrieved by
|
|
.IR pthread_join ().
|
|
If a thread returns from its start function [see
|
|
.IR pthread_create ()]
|
|
it acts as if it had called
|
|
.IR pthread_exit ()
|
|
with
|
|
.I retval
|
|
as the value returned.
|
|
A thread implicitly exits when it acts on a cancellation request [see
|
|
.IR pthread_cancel ()].
|
|
.\"
|
|
.PP
|
|
When a thread exits it pops and executes any cancellation handlers
|
|
which are still active [see
|
|
.IR pthread_cleanup_push ()].
|
|
Following the handlers, per-thread data is destroyed by invoking the
|
|
destructor function for any non-zero thread specific values
|
|
associated with active keys [see
|
|
.IR pthread_key_create ()].
|
|
.\"
|
|
.PP
|
|
When the last thread terminates the process exits with a zero status
|
|
value.
|
|
.\"
|
|
.\" ----------------
|
|
.SH DIAGNOSTICS
|
|
No value is returned by
|
|
.IR pthread_exit ().
|
|
.\"
|
|
.\" ----------------
|
|
.SH "SEE ALSO"
|
|
pthread_create(3P), pthread_join(3P), pthread_cancel(3P),
|
|
pthread_cleanup_push(3P), pthread_key_create(3P).
|