The pthread_kill callable service targets a signal to a particular thread. The service is limited to interthread communication within a process.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1PTK): | 31-bit |
AMODE (BPX4PTK): | 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 BPX4PTK with the same parameters.
The name of an 8-byte field that contains the target thread that is to receive the signal.
The name of a fullword field that contains the signal number that is to be sent to the thread that is indicated by the Thread_ID parameter. This must be one of the signals defined in BPXYSIGH macro, or 0.
If the signal is 0, error checking takes place, but no signal is sent. The pthread_kill service can be called with a signal value of 0, to verify that Thread_ID parameter is correct before the signal is actually sent.
The name of a fullword in which the pthread_kill service returns 0 if the request is successful, or -1 if it is not successful.
Return_code | Explanation |
---|---|
EINVAL | One of the following conditions causes this return code:
The following reason codes can accompany the return code: JRInvalidSignal, JRLightWeightThid, JRThreadNotFound, and JRThreadTerm. |
The name of a fullword in which the pthread_kill service stores the reason code. The pthread_kill 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.
SIGTHSTOP and SIGTHCONT can only be issued to threads within the same process. If all the threads in a process are stopped with SIGTHSTOP, the process is virtually hung. No other threads can send a SIGTHCONT signal to wake them up. The stopped threads must be manually killed.
The SIGTHSTOP and SIGTHCONT signals are noncatchable, nonblockable, and cannot be ignored.
There are no restrictions on the use of the pthread_kill service.
For an example using this callable service, see BPX1PTK (pthread_kill) example.
Delivery of a signal to the signal interface routine occurs only when the PSW key of the caller is equal to the signal delivery key of the process. The signal delivery key is set to the PSW key of the caller of the first callable service that dubbed the process.