Interrogating the Interlock Status

The LOCKSTATUS function returns the state and ownership of the specified interlock. The LOCKSTATUS function is of type REAL, and the result has the following subfields:

Field

Value and Meaning

[47:24]

Stack number of the owner process. If the current state is FREE, this field stores a 0.

[23:22]

Undefined

[01:02]

Current state:

 

0

FREE

 

1

LOCKED_UNCONTENDED

 

2

LOCKED_CONTENDED

Following are examples of the LOCKSTATUS function:

R := LOCKSTATUS (MYLOCK);

OWNERID := LOCKSTATUS (YOURLOCKS [3]).[47:24];

IF I := LOCKSTATUS (YOURLOCKS [3]).[47:24] = PROCESSID THEN
            GOFORIT;