Examples of $ZGETLKI()

Example 1:

    GTM> WRITE $ZGETLKI(lk,"RESNAM")
    GTM$LM
    GTM>
    

This uses $ZGETLKI() to examine a VMS lock resource name.

Example 2:

    IF $ZGETLKI(lk,"PID")=$JOB WRITE lk,!,?10,"is mine"
    

This uses $ZGETLKI() as the argument to an IF command such that the write only executes when the process owns the VMS lock, identified by lk. This depends on the fact that GT.M uses the VMS PID for the value of the $JOB Intrinsic Special Variable.