Patent ID: 8490095

Claim:
A method for detecting program deadlock, comprising: obtaining lock information related to locking operation in a program to form obtained lock information; generating a first lock graph based on the obtained lock information, wherein each node in the first lock graph comprises a set of locks comprising at least one lock and a set of program locations comprising at least one program location; extracting a strongly connected sub graph in the first lock graph; unfolding the strongly connected sub graph in the first lock graph to generate a second lock graph, wherein each node in the second lock graph comprises a single lock; and extracting a strongly connected sub graph in the second lock graph, the strongly connected sub graph in the second lock graph indicating a deadlock in the program, wherein the step of generating a first lock graph based on the obtained lock information comprises: determining whether a lock indicated by the obtained information on locking operation of a particular thread at a particular program location and a program location corresponding to the lock have been recorded in a reserved node of the first lock graph.