getQueuedLocks

getQueuedLocks(locks:      LockArray input;
               maxEntries: Integer);

The getQueuedLocks method of the System class is similar to the getObjectLockProcesses and getLocks methods, but it includes only the lock requests that are waiting for objects to be unlocked by the processes that currently have them locked.

The value of the maxEntries parameter specifies the maximum number of entries to be inserted into the array specified by the locks parameter. Entries are inserted in no particular order.

The following example shows the use of the getQueuedLocks method.

vars
    lock      : Lock;
    lockArray : LockArray;
begin
    create lockArray transient;
    system.getQueuedLocks(lockArray, 40);
    foreach lock in lockArray do      //access the lock entry properties
        write lock.requestedBy.String;
        write lock.elapsedTime.String;
        write lock.waitTime.String;
    endforeach;
epilog
    lockArray.purge;
    delete lockArray;
end;

Lock objects returned in the locks parameter can have lock entries in the array that have the Lock class lockedBy property set to null if the lock request is still waiting to be processed in the lock queue.

When this occurs, the process that caused the lock request to be queued has already released it but because of high activity on the executing node, the lock request has not been retried.