The pthread_cancel callable service generates a cancelation request for the target thread.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1PTB) | 31-bit |
AMODE (BPX4PTB) | 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 BPX4PTB with the same parameters.
The name of an 8-byte field that contains the thread ID for the thread that is to be canceled.
The name of a fullword in which the pthread_cancel service returns 0 if the thread is canceled or the cancel is pending, or -1 if a failure occurs.
Return Code | Explanation |
---|---|
EINVAL | The value that was specified by thread ID is not valid. It does not contain a value that is consistent with thread IDs managed by the system. The following reason code can accompany this return code: JRLightWeightThID. |
ESRCH | The value that was specified by Thread_ID does not refer to a thread that currently exists. The following reason codes can accompany this return code: JRThreadNotFound and JRAlreadyTerminated. |
The name of a fullword in which the pthread_cancel service stores the reason code. The pthread_cancel service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.
There are no restrictions on the use of the pthread_cancel service.
For an example using this callable service, see BPX1PTB (pthread_cancel) example.