NET/MASTER Network Control Language (NCL) Reference Manual

LOCK
Verbs
106126 Tandem Computers Incorporated 3–117
YES
specifies that the LOCK function must wait indefinitely until the request can
be granted or until it fails (for TYPE=SHR or TYPE=EXCL). For TYPE=TEST,
the request waits indefinitely or until the next request, of any type, is made by
another NCL process.
nnnn
specifies that the LOCK function must wait for the indicated interval for the
request to be granted. If the request is not granted within this interval, control
returns to the issuing NCL process. The time value can be from 0 (zero)
through 9999 seconds. For TYPE=TEST the request waits for the specified
period or until the next request of any type is made by another NCL process.
WAIT=0 has the same affect as WAIT=NO.
Considerations
When the execution of the LOCK verb containing the operand TYPE=EXCL or
TYPE=SHR completes, the &SYS.RETCODE system variable is set as follows:
Return
Code
Description
0 Access to the resource is granted. For an EXCL request no other NCL processes
may gain access to the resource until it is explicitly freed or until the NCL process
terminates.
4 The request has been ignored because this NCL process already has control of the
resource. The &SYS.LOCK.MSG system variable is set to the text of the existing
lock. The &SYS.FDBK system variable is also set; this is described by a later
consideration.
8 Access to the resource is denied. Another NCL process has control of the resource.
The &SYS.LOCK.MSG system variable contains the text of the oldest request that
obtained control of the resource. The &SYS.FDBK system variable is also set; this is
described by a later consideration.
When WAIT=YES or WAIT=
nnn
is specified, the &SYS.RETCODE system variable
is set as follows:
Return
Code
Description
12 The request is denied. Access to the resource is not possible. A PURGE command
has been issued for the waiting lock request, or the time limit has expired. The
&SYS.LOCK.MSG system variable contains the text of the oldest request that
obtained control of the resource. The &SYS.FDBK system variable is also set; this is
described by a later consideration.