10.2.6.3 Completion Phase

When an application-created server thread has finished its work, the thread calls tpappthrterm(3c) to terminate the current context.

tpappthrterm(3c) affects all application-created server threads that are currently working on the same context. Avoid calling tpappthrterm(3c) while other application threads are still working on the terminated context.

A well-designed application normally waits for all work in a particular context to complete before it calls tpappthrterm(3c). Be sure that all application threads are synchronized before your application thread calls tpappthrterm(3c).