158 | | * If the FLAG_JOIN_DONE is set, the J thread arrived first and is blocked on the BLOCKED_JOIN condition: the K thread unblocks the J thread from the BLOCKED_JOIN condition (using the ''join_xp'' field in the T thread), reset the JOIN_DONE flag in T thread, registers the exit status in the T thread ''exit_status'' field (only when the K thread is the T pthread itself executing the pthread_exit() function), releases the ''join_lock'' in T thread, and finally completes the T thread destruction as described in the detached case. |
| 158 | * If the FLAG_JOIN_DONE is set, the J thread arrived first and is blocked on the BLOCKED_JOIN condition: the K thread registers the exit status in the J thread ''exit_status'' field (only when the K thread is the T pthread itself executing the pthread_exit() function), unblocks the J thread from the BLOCKED_JOIN condition (using the ''join_xp'' field in the T thread), reset the JOIN_DONE flag in T thread, releases the ''join_lock'' in T thread, and finally completes the T thread destruction as described in the detached case. |
161 | | * If the FLAG_KILL_DONE is set, the K thread arrived first and is blocked on the BLOCKED_JOIN condition: the J thread get the ''exit_status'' from the T thread, unblocks the K thread, resets the FLAG_KILL_DONE in the T thread, releases the "join_lock" in T thread, and returns. |
162 | | * If the FLAG_KILL_DONE is not set, the J thread arrived first: the J thread registers its extended pointer in the T thread "join_xp" field, set the FLAG_JOIN_DONE in the T thread, sets the BLOCKED_EXIT bit in the J thread, releases the "join_lock" in the T thread, and deschedules. It get the ''exit_status'' from the T thread and returns when it is unblocked by the K thread. |
| 161 | * If the FLAG_KILL_DONE is set, the K thread arrived first and is blocked on the BLOCKED_JOIN condition: the J thread get the ''exit_status'' from the T thread to the J thread descriptor, unblocks the K thread, resets the FLAG_KILL_DONE in the T thread, releases the "join_lock" in T thread, and returns. |
| 162 | * If the FLAG_KILL_DONE is not set, the J thread arrived first: the J thread registers its extended pointer in the T thread "join_xp" field, set the FLAG_JOIN_DONE in the T thread, sets the BLOCKED_EXIT bit in the J thread, releases the "join_lock" in the T thread, and deschedules. It get the ''exit_status'' from its own T thread and returns when it is unblocked by the K thread. |