1. A method of detecting deadlock in a multithreading program, comprising the steps of: constructing an invocation graph having a single root and a plurality of nodes corresponding to one or more functions written in code of the multithreading program; computing a resource graph in accordance with one or more resource sets in effect at each node of the invocation graph; and determining whether cycles exist between two or more nodes of the resource graph, wherein a cycle is an indication of deadlock in the multithreading program.