Deadlock detection is one of the most discussed problems in the literature. Although several al- gorithms have been proposed, the problem is still open. In general, the correct operation of an algorithm depends on the requirement model being considered. This article introduces a deadlock detection algorithm for the OR model. The algorithm is complete, because it detects all deadlocks, and it is correct, because it does not detect false deadlocks. In addition, the algorithm supports dynamic changes in the wait-for graph on which it works. Once finalized the algorithm, at least each process that causes deadlock knows that it is deadlocked. Using this property, possible extensions are suggested in order to resolve deadlocks.