When multiple processes have access to the same interlock, you need to plan for the possibility that a process might be discontinued while it has ownership of the interlock. This is the same problem that occurs for shared events, as previously discussed under Discontinued Processes and Events in this section. Interlocks incorporate the following features that help you to deal with this problem:
For example, if you believe that the process is normally unlikely to have to wait more than one minute, you could include a 60-second time limit in the LOCK function. If the time limit expires, the process could use LOCKSTATUS to determine the stack number of the current owner of the interlock. The process could then use GETSTATUS call type 6 (Mix Entries), Subtype 4, to determine whether the owner process is still running. If the owner process has terminated, this process could use an UNLOCK statement to make the interlock available for locking again.

