Patent ID: 8069445

Claim:
A method comprising: for a first thread which acquires a synchronization primitive, recording a set of currently-held synchronization primitives and a set of currently-acquired synchronization primitives; indicating a possibly-unsafe lock release when the first thread releases a resource set s of resource set elements r and one or more of the resource set elements r of the resource set s was not among a plurality of resource set elements acquired by the first thread on entry to the synchronization primitive previously acquired by the first thread; constructing a graph of connected nodes, where a node indicates the set of currently-held synchronization primitives and the set of currently-acquired synchronization primitives; searching the graph for a node to indicate the set of currently-held synchronization primitives and the set of currently-acquired synchronization primitives; and searching for a lock acquisition hierarchy violation, in which a second thread acquires a partial acquisition hierarchy of the synchronization primitive previously acquired by the first thread, wherein searching for a lock acquisition hierarchy violation comprises searching for a cycle in the graph; reporting the lock acquisition hierarchy violation; and reporting the possibly-unsafe lock release.