Testing threads (deadlocks)