Resuming execution of a suspended RB
The RESUME macro, which is supported in cross memory mode, provides an efficient means for indicating the completion of an event. The RESUME macro specifies the TCB and RB that were previously suspended by the SUSPEND macro. The specified TCB and RB must be addressable in the currently addressable address space. Only routines executing in supervisor state and PSW key zero can issue the RESUME macro.
The RESUME macro and the service routine it calls must serialize the use of the task that is being resumed. This serialization might require the local lock of the task's address space, called the target address space. Because disabled or locked callers of RESUME are not allowed to obtain a local lock, the RESUME macro has the MODE and ASYNC options to handle these types of situations.
The MODE option specifies whether or not the RESUME operation must complete (MODE=UNCOND) or not (MODE=COND).
- MODE=UNCOND and ASYNC=N
- RESUME attempts to obtain the necessary task serialization to
complete the function synchronously. If it can obtain serialization,
RESUME completes its function and returns to its caller. If it cannot
obtain serialization, RESUME requests the local lock of the target
address space to serialize the operation. The caller of RESUME must
be able to obtain the target address space's local lock or already
hold it when RESUME is issued. This means that, with one exception,
the caller of RESUME must either be running enabled and unlocked or
must hold the target address space's local lock when the RESUME is
issued. The exception is the disabled caller that resumes the TCB
under which it is running, that is, the currently executing TCB. This
situation could occur if, for example, a routine became disabled,
executed a SUSPEND RB=CURRENT macro, and then determined that there
was more work to be done. The disabled, unlocked routine could issue
a RESUME macro for the TCB and RB to counteract the SUSPEND.
If the local lock is required but not available, the caller will be suspended waiting for the local lock. Control returns to the caller after the RESUME has occurred.
- Disabled interrupt exits cannot issue the RESUME macro with the MODE=UNCOND and ASYNC=N options.
- The RETURN=N option on the RESUME macro is allowed only with this combination of options. The RETURN=N option cannot be used with the ASCB parameter. To use RETURN=N, the caller must be running in SRB mode, must be in primary ASC mode where primary=home, and must not hold any locks. If these three conditions are met, the system transfers control to the task that was just resumed. If these three conditions are not met, that caller is abended with an X'070' abend code.
- RESUME attempts to obtain the necessary task serialization to
complete the function synchronously. If it can obtain serialization,
RESUME completes its function and returns to its caller. If it cannot
obtain serialization, RESUME requests the local lock of the target
address space to serialize the operation. The caller of RESUME must
be able to obtain the target address space's local lock or already
hold it when RESUME is issued. This means that, with one exception,
the caller of RESUME must either be running enabled and unlocked or
must hold the target address space's local lock when the RESUME is
issued. The exception is the disabled caller that resumes the TCB
under which it is running, that is, the currently executing TCB. This
situation could occur if, for example, a routine became disabled,
executed a SUSPEND RB=CURRENT macro, and then determined that there
was more work to be done. The disabled, unlocked routine could issue
a RESUME macro for the TCB and RB to counteract the SUSPEND.
- MODE=UNCOND and ASYNC=Y
- RESUME attempts to obtain the necessary task serialization and complete the function synchronously. If RESUME cannot obtain serialization, RESUME does not obtain the local lock. RESUME unconditionally schedules an SRB to complete the RESUME asynchronously.
- The caller can be enabled or disabled.
- MODE=COND and ASYNC=N
- RESUME attempts to obtain the necessary task serialization to complete the function synchronously. If serialization is available, the task is resumed and control returns to the caller. If serialization is not available, RESUME returns to the caller without completing the RESUME operation.
- The caller can either be enabled or disabled and can hold any combination of locks. RESUME does not attempt to obtain any locks. The caller must be prepared to handle the situation when the RESUME operation cannot be performed because the necessary serialization is not available.
- MODE=COND and ASYNC=Y
- RESUME attempts to obtain the necessary serialization to complete the function synchronously. If serialization is available, the task is resumed and control returns to the caller. If serialization is not available, RESUME might schedule an SRB to complete the RESUME asynchronously.
- The caller can be either enabled or disabled, and can hold any combination of locks. RESUME does not attempt to obtain any locks. The caller must be prepared to handle the situation when the RESUME operation cannot be performed because the necessary serialization is not available and the RESUME could not be processed asynchronously.
RESUME provides return codes in register 15 to indicate the result of the RESUME attempt. See the RESUME macro in z/OS MVS Programming: Authorized Assembler Services Reference LLA-SDU for details on the return codes.
The RESUME macro requires that you include the IHAPSA mapping macro. If the ASCB option is not specified, then the MODE=UNCOND and ASYNC=Y combination requires that you include the CVT mapping macro.