The present invention provides a method of implementing a fault-tolerant
mutual exclusion lock. The present invention records in a lock structure
the IDs of all processes whose failure can lead to the permanent
unavailability of the lock. When a process finds the lock unavailable and
suspects a permanent failure, it queries the programming environment
about the status of all or some of the processes that could have caused
the lock's unavailability. If the programming environment determines that
these processes have failed, the live process tries to usurp the lock. If
it succeeds, it executes some recovery mechanism and frees the lock or
proceeds to operate on the objects protected by the lock. The method
guarantees recovery from process failures.