Waiting for event completion (EVENTS)
The EVENTS macro allows a user to wait for the completion of one of a series of events and be directly informed by the system which of the events have completed. Branch entry to this function, which is more efficient than SVC entry, is available to users executing in key 0, supervisor state, and holding only the LOCAL lock.
Branch entry is specified by coding BRANCH=YES on the EVENTS macro.
If this parameter is used, the branch entry routine performs all normal
WAIT processing and ECB initialization. You can specify BRANCH=YES
in conjunction with either WAIT=YES, WAIT=NO, or ECB=.
- If you specify WAIT=YES, control will later be returned to the
system, even though there might be ECBs posted to the EVENTS table. EVENTS frees the LOCAL lock. Before
issuing the EVENTS macro with the WAIT=YES option, you must establish
the return environment by setting the following:
- RBOPSWA - Set with the PSW, which contains the address of the routine that is to receive control when the event completes
- TCBGRS - Set to the general purpose registers (GPRs)
- If you do not specify WAIT=YES, control returns to you. EVENTS does not free the LOCAL lock.