×

Method and apparatus for detecting lock acquisition hierarchy violations and unsafe lock releases

  • US 8,069,445 B2
  • Filed: 06/30/2006
  • Issued: 11/29/2011
  • Est. Priority Date: 06/30/2006
  • Status: Active Grant
First Claim
Patent Images

1. 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.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×