terminate execution of the calling thread
cc [options] -Kthread file
void thr_exit(void *status);
thr_exit terminates execution of the calling thread.
status is the exit value
of the terminating thread.
The status will be returned to one of any sibling threads
If the start function of the thread (see
returns without calling thr_exit,
thr_exit is called implicitly
with status set to the return
value of the function.
No error checking of status is done,
as other values can be cast to (void *)
After thr_exit has been called,
all thread-specific data bindings are discarded
and the thread data structures can be recycled.
the exit value of the thread
thr_exit does not return a value.
For portability, use status only as a pointer;
do not cast an int to void * to be used as the status
argument, and then cast it back to int when it is retrieved
The ANSI C standard does not require that implementations
cast values to (void *) and then back to the initial type
without losing information.
There are three ways a threaded process terminates:
Any thread in the process calls exit.
All non-daemon threads in the process terminate.
The initial call to main returns without
A call to thr_exit by the initial thread
does not terminate the process,
unless it is the last non-daemon thread.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004