POSIX thread termination

A thread terminates due to pthread_exit(), pthread_kill(), or pthread_cancel(), or 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
  • Language Environment user-written condition handlers are run, if present
  • The thread status is set
  • Cleanup handlers and destructor routines are driven
  • The stack is collapsed
  • HLL members are called for thread termination