1. A method for detecting a race condition, comprising storing, in a first memory location shared by two or more threads, a seed value to a first global variable D; identifying a race condition when a second global variable A, stored in a second memory location shared by the two or more threads, does not equal a first predefined value V 1 , wherein the second global variable A was set to the first predefined value V 1 at an initiation event prior to storing the seed value; storing a second predefined value V 2 to the second global variable A; identifying a race condition when the first global variable D does not equal the seed value; accessing a shared resource; and storing the first predefined variable V 1 to the second global variable A.