The WAIT statement relinquishes control either to the system, pending completion of one or more events, or to a higher priority ready-to-run task. If control is relinquished to wait for the completion of one or more events, an event control block (ECB) must be defined for each event. If an ECB is already posted when the WAIT is issued, the task is redispatched immediately and control does not pass to another task.
┌───────────────┐ ►►─── WAIT ─┬──┬─ LONG ◄ ─┬─┬─▼─ EVENT (ecb) ─┴─────┬─┬───────────────────────► │ └─ SHORT ──┘ └─ EVENT NAME (ecb-id) ─┘ │ └─ REDISPATCH ────────────────────────────┘ ►──┬───────────────────────────────────┬─ ; ──────────────────────────────────►◄ └─ STALL INTERVAL (stall-interval) ─┘
Specifies whether the wait is expected to be of long-term or short-term duration.
Specifies that the wait is expected to be long-term. LONG should be specified for all waits expected to last a second or more (for Example, terminal input). LONG is the default.
Specifies that the wait is expected to be short-term. SHORT should be specified for all waits expected to last less than a second (for Example, a disk I/O).
Specifies an event upon which the issuing task is to wait.
Defines one or more ECBs upon which the task will wait. ecb is the symbolic name of a user-defined area that contains three binary fullword fields that contain the ECB. Multiple EVENT parameters must be separated by at least one blank.
Specifies the 4-character symbolic ID of the ECB upon which the task will wait. Ecb-id is either the symbolic name of a user-defined field that contains the ECB ID, or the ID itself enclosed in quotation marks. Multiple EVENT NAME parameters cannot be specified.
Specifies that the issuing task wishes to relinquish control to any higher priority ready-to-run task before being redispatched.
Indicates the time, in wall-clock seconds, that the system is to suspend processing of the issuing task. Stall-interval is the symbolic name of a user-defined fixed binary field containing the stall interval, or the interval itself expressed as a numeric constant.
The following statement requests a short-term wait on the event PODB:
WAIT
SHORT
EVENT NAME ('PODB');
Upon completion of the WAIT function, the ERROR_STATUS field in the IDMS DC communications block indicates the outcome of the operation:
The request has been serviced successfully.
To wait on the specified ECB would cause a deadlock.
|
Copyright © 2014 CA.
All rights reserved.
|
|