Deadlock Detection in Distributed Systems