THRD_EXIT(3C) Standard C Library Functions THRD_EXIT(3C)
NAME
thrd_exit - terminate a thread
SYNOPSIS
#include <threads.h> _Noreturn void thrd_exit(
int res);
DESCRIPTION
The
thrd_exit() function terminates the calling thread, in a similar way
that
exit(3C) terminates the calling process. If the calling thread has
not been detached, then the exit status information provided in
res is
saved and can be retrieved by the use of the
thrd_join(3C) function.
When the thread exits, all signals will be blocked and various destructors
and clean up handlers will be called, such as those registered with
tss_create(3C). The act of thread termination does not cause any process-
wide resources, such as mutexes and file descriptors to be released.
If a thread, other than the thread in which
main() was first invoked
returns from its starting routine, it will implicitly call
thrd_exit() and
set the return value to be its exit status.
RETURN VALUES
The
thrd_exit() function does not return, the calling thread is terminated.
INTERFACE STABILITY
StandardMT-LEVEL MT-SafeSEE ALSO
pthread_exit(3C),
thr_exit(3C),
attributes(7),
attributes(7),
threads(7)OmniOS January 13, 2015 OmniOS