PTHREAD_EXIT(3) BSD Programmer's Manual PTHREAD_EXIT(3)NAMEpthread_exit - terminate the calling thread
SYNOPSIS
#include <pthread.h>
void
pthread_exit(void *value);
DESCRIPTION
This interface is defined by IEEE Std1003.1c (``POSIX'').
The pthread_exit() function terminates the calling thread and makes the
value value available to a thread executing a successful join. Any can-
cellation cleanup handlers that have been registered for the calling
thread will be popped and executed in the reverse order that they were
registered. After registered cleanup handlers have been executed, if the
calling thread has any thread specific data destructor functions, these
are called.
Calling pthread_exit() does not release any thread-related resources that
the calling thread may hold (such as mutexes, file descriptors, etc.).
It is the responsibility of the programmer to ensure that such resources
are freed before the pthread_exit() function is called.
After a thread terminates, accesses to local stack variables of the call-
ing thread are undefined. If a value is being returned in value, it
should not be allocated on the calling thread's local stack.
RETURN VALUES
The pthread_exit() function does not return to its caller.
SEE ALSOpthreads(3), pthread_create(3), pthread_exit(3), pthread_detach(3),
pthread_join(3)STANDARDS
The pthread_exit function conforms to IEEE Std1003.1c (``POSIX'').
HISTORY
The pthread_exit function first appeared in BSD/OS 3.0.
4th Berkeley Distribution June 3, 1996 1