1. A method of deadlock detection, comprising: collecting statistics of frequency of deadlocks detected in a system; adjusting a threshold timeout value for a lock based on the statistics; if a waiting time associated with the lock exceeds the threshold timeout value, initiating a deadlock detection based on the lock; and wherein the method is performed by one or more computing devices.