A thread terminates due to
pthread_exit(),
pthread_kill(),
or
pthread_cancel(), or simply returns from the start
routine of the thread in a POSIX environment. When a thread issues
a
exit() or
_exit() or encounters
an unhandled condition, that thread terminates and all other active
threads are also forced to terminate. The
z/OS UNIX (POSIX)
environment supports multiple threads; each thread is terminated,
as follows:
- The stack storage associated with the thread is freed
- The thread status is set
- Cleanup handlers and destructor routines are driven
- The stack is collapsed
For more detailed information on POSIX functions, refer to the
following resources: