Table 1 describes the actions that are taken when pthread_exit_and_get is issued for a thread that is the IPT and is the last thread.
Step | IPT task is the only task | Thread 2 doesn't exist |
---|---|---|
1 | A request to exit the pthread was issued. | |
2 | Run thread cleanup routines before this thread terminates. | |
3 | Call pthread_exit_and_get with the PTEXITTHREAD and PTFAILIFLASTTHREAD options to terminate the thread on the IPT. | |
4 | A return value and reason code reporting a failure from pthread_exit_and_get indicates that this is the last thread. | |
5 | Process the remaining thread and cleanup (such as running exits). | |
6 | Call pthread_exit_and_get without the PTFAILIFLASTTHREAD option to terminate the last thread and the process. | |
7 | Control is returned to the IPT from pthread_exit_and_get, and all threads terminate. | |
8 | The mvsprocclp service is issued to clean up any remaining portions of the process. Control returns from this service after all subtasks created with pthread_create terminate, or until the time to do so has elapsed. | |
9 | The IPT task gains control when the mvsprocclp service completes. All pthreads for this process and all subtasks of the IPT have terminated. | |
10 | The IPT task is no longer associated with the kernel, and can now return to its caller or to the system. |