The two primary functions of the M Lock Utility (LKE) are:
SHOW all or specified LOCKs currently active
CLEAR all or specified LOCKs currently active
When debugging an M application, you may use LKE to identify and clear a possible deadlock situation, that is, two or more processes have LOCKs and are waiting to add resource names LOCKed by the other(s).
Process 1 Process 2
LOCK A
LOCK B
LOCK +A
LOCK +B
Process 1 has A LOCKed and attempts to LOCK B. Process 2 has B LOCKed and attempts to LOCK A. Because these processes do not release their current LOCKs before adding additional LOCKs, nor do they provide a timeout to detect the problem, they are deadlocked. Neither process can proceed normally. You can use LKE to release one of the LOCKs so both processes may execute. However, because releasing a LOCK may cause the process to violate its design assumptions, terminating one process is generally a safer way to break the deadlock.