Spot dead locks:

Record the PID of the lock owner, and check if the PID still exists when we fail to obtain the lock.
please add spaces