simple deadlock detector and deadlock