The pthread_exit_and_get callable service exits a thread, gets a new thread request to process, or both. To start a new thread request, see pthread_create (BPX1PTC, BPX4PTC) — Create a thread.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1PTX): | 31-bit |
AMODE (BPX4PTX): | 64-bit |
ASC mode: | Primary mode |
Interrupt status: | Enabled for interrupts |
Locks: | Unlocked |
Control parameters: | All parameters must be addressable by the caller and in the primary address space. |
|
AMODE 64 callers use BPX4PTX with the same parameters. The Status_field and Signal_setup_userdata parameters are doublewords.
The name of a fullword (doubleword) field that contains the status of the exiting thread. This status is available to any other thread that uses the pthread_join service to wait for the termination of this thread.
The default option value is PTEXITTHREAD. The option values are defined in the BPXYCONS macro; see BPXYCONS — Constants used by services. You can combine options by specifying a plus between them.
The name of a fullword (doubleword) field that contains 4 bytes (8 bytes) of user data that is normally supplied on the signal setup service, mvssigsetup. This field is used only when the PTGETNEWTHREAD option is specified. If this field contains a zero address, the signal setup user data is not changed for this thread. This field is ignored when the PTEXITTHREAD option is specified.
This parameter list is mapped by the BPXYPTXL macro; see BPXYPTXL — Map the parameter list for pthread_create. The storage for the list is supplied by the system and should not be modified or freed by the caller of pthread_exit_and_get.
Return code | Explanation |
---|---|
EINVAL | One of the parameters contains a value that is not valid. The following reason codes can accompany the return code: JRInvOption, JRGetFirst, JRHeavyWeight, JRQuiesceInProcess, and JRLastThread. |
The name of a fullword in which the pthread_exit_and_get service stores the reason code. The pthread_exit_and_get service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. See z/OS UNIX System Services Messages and Codes for the reason codes.
For an example using this callable service, see BPX1PTX (pthread_exit_and_get) example.