detect deadlocks. throw own exceptions