deadlock detection and recovery-fig-2