1. A computer-implemented method comprising: constructing a lock acquisition hierarchy graph having a lock acquisition hierarchy (“hierarchy”) to facilitate monitoring of resource operations corresponding to each of a plurality of threads of a multithreaded program; monitoring the resource operations being performed in accordance with the hierarchy; detecting a violation in the hierarchy, wherein the detecting of the violation is triggered with an occurrence of a change in the graph; wherein the violation is detected if a set of conditions is satisfied, and the violation is not detected if one or more of the set of conditions is not satisfied; and correcting the violation in the hierarchy by adding a new node to the graph, updating acquired resources of a corresponding thread with acquired resources of the new node, and updating held resources of the corresponding thread with held resources of the new node.