Patent ID: 7685572

Claim:
A method for detecting a race condition using static analysis comprising: generating a first lock set, wherein the first lock set represents access rights that a first path of a plurality of paths has to a plurality of data elements when accessing a first data element of the plurality of data elements; generating a second lock set, wherein the second lock set represents access rights that a second path of the plurality of paths has to the plurality of data elements when accessing a second data element of the plurality of data elements; generating a first permit set for the first lock set, wherein generating the first permit set comprises: creating a first data set, wherein the first data set comprises each data element of the plurality of data elements on which the first data element is dependent wherein the first data set comprises at least two data elements, and wherein the first permit set associates the first data set with access rights that the first path has to the plurality of data elements when accessing the first data element; generating a second permit set for the second lock set, wherein generating the second permit set comprises: creating a second data set, wherein the second data set comprises each data element of the plurality of data elements on which the second data element is dependent, and wherein the second permit set associates the second data set with access rights that the second path has to the plurality of data elements when accessing the second data element; and performing a static analysis, using a processor of a computer system, wherein the static analysis comprises using the first permit set and the second permit set to detect a race condition, wherein the static analysis is performed prior to accessing critical data and comprises: determining that the intersection of the first data set and the second data set is not empty; determining whether the intersection of the first permit set and the second permit set is empty based on the intersection of the first data set and the second data set being not empty; and if the intersection of the first permit set and the second permit set is empty, then outputting a value indicating the detection of the race condition.