Call the Latch_Release service to release ownership of an owned
latch or a pending request to obtain a latch. Requestors should call
Latch_Release when the use of a resource associated with a latch is
no longer required. The following callable services are related to
Latch_Release:
- ISGLCRT
- Creates a latch set that an application can use to serialize resources.
- ISGLOBT
- Requests exclusive or shared control of a latch.
- ISGLPRG
- Purges all granted and pending requests for a particular requestor
within a specific latch set.
In the following description of Latch_Release:
- The term requestor describes a program that calls the Latch_Release
service to release ownership of an owned latch or a pending request
to obtain a latch.
- Constants defined in the latch manager IDFs are followed by their
numeric equivalents; you may specify either when coding calls to Latch_Obtain.
For example, “ISGLREL_COND (value of 1)” indicates the constant ISGLREL_COND
and its associated value, 1.
Write the CALL as shown on the syntax diagram, coding all parameters
in the specified order.
Assign values to the following parameters:
- latch_set_token
- latch_token
- release_option
Latch_Release returns a value in the following parameter:
Latch_Release uses the following parameter for temporary storage:
CALL statement |
Parameters |
---|
CALL ISGLREL
|
(latch_set_token
,latch_token
,release_option
,work_area
,return_code)
|
The parameters are explained as follows:
- latch_set_token
- Specifies an 8-byte area that contains the latch set token returned
to the caller of the Latch_Create service. The latch set token identifies
the latch set that contains the latch to be released.
- ,latch_token
- Specifies an 8-byte area that contains the latch token returned
to the caller of the Latch_Obtain service. The latch token identifies
the request to be released.
- ,release_option
- Specifies a fullword integer that tells the latch manager what
to do when the requestor either no longer owns the latch to be released
or still has a pending request to obtain the latch to be released:
- ISGLREL_UNCOND (value of 0)
- Abend the requestor:
- If a requestor originally specified an obtain_option of ISGLOBT_SYNC
(value of 0) when obtaining the latch, the latch manager does not
release the latch. The system abends the caller of Latch_Release
with abend X'9C6', reason code xxxx0009.
- If a requestor originally specified an obtain_option of ISGLOBT_ASYNC_ECB
(value of 2) when obtaining the latch, the latch manager does not
release the latch. The system abends the caller of Latch_Release
with abend X'9C6', reason code xxxx0007.
- If the latch manager does not find a previous Latch_Obtain request
for the specified latch, the system abends the caller of Latch_Release
with abend X'9C6', reason code xxxx000A.
- ISGLREL_COND (value of 1)
- Return control to the requestor:
- If a requestor originally specified an obtain_option of ISGLOBT_ASYNC_ECB
(value of 2) when obtaining the latch, the latch manager releases
the request for ownership of the latch. The system returns control
to the caller of Latch_Release with a return code of ISGLREL_NOT_OWNED_ECB_REQUEST
(value of 4).
- If a requestor originally specified an obtain_option of ISGLOBT_SYNC
(value of 0) when obtaining the latch, the latch manager does not
release the request for ownership of the latch. The system returns
control to the caller of Latch_Release with a return code of ISGLREL_STILL_SUSPENDED
(value of 8).
- If the latch manager does not find a previous Latch_Obtain request
for the specified latch, the system returns control to the caller
of Latch_Release with a return code of ISGLREL_INCORRECT_LATCH_TOKEN
(value of 12).
- ,work_area
- Specifies a 256-byte work area that provides temporary storage
for the Latch_Release service. The work area should begin on a doubleword
boundary to optimize performance. The work area must be in the same
storage key as the caller of Latch_Release.
- ,return_code
- Specifies a fullword integer that is to contain the return code
from the Latch_Release service.