The cond_wait callable service allows the caller's thread to suspend processing until any one of a set of events has occurred.
Operation | Environment |
---|---|
Authorization: | Problem program or supervisor state, PSW key when the process was created (not PSW key 0) |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1CWA): | 31-bit |
AMODE (BPX4CWA): | 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 BPX4CWA with the same parameters.
The name of a fullword that contains a value that determines which events will cause the thread to resume processing.
An Event_list of zero means that the caller has used the cond_setup service to specify the events, and the thread is already eligible to be notified of events. In this case, the cond_wait service suspends thread processing until an event occurs or a signal arrives.
The name of a fullword in which the service returns a 0 a CW_CONDVAR event occurred, or -1 otherwise.
Error | Explanation |
---|---|
EINTR | A signal caused the cond_wait service to resume processing
of the thread. Note: The signal handler has already run.
|
EINVAL | The system determined that one or more of the parameters that were passed to the service are in error. The following reason codes unique to the cond_wait call can accompany the return code: JRAlreadySetup, JRNotSetup, JRUndefEvents. |
The name of a fullword in which the service routine stores the reason code. The cond_wait service stores a reason code only when the return value is -1. The reason code further qualifies the return code value. See z/OS UNIX System Services Messages and Codes for the reason codes.
The only exception to this is the queue_interrupt service. You may use the queue_interrupt service to "put back" the last signal delivered to the signal interface routine. A signal may arrive after the program that is running on the thread has called cond_setup and before it gets a chance to call cond_wait. The program may choose to "put back" the signal to defer handling it until a later time.
If you use cond_setup to specify the events that will cause the thread to resume processing, you must repeat the setup before each call to cond_wait or cond_timed_wait.
See The relationship of z/OS UNIX signals to callable services.
See BPX1CWA (cond_wait) example for an example using this callable service.