1. A method for detecting one or more data races in a concurrent program, the method comprising performing by a computer the acts of: generating locksets for an execution of the program; wherein locksets comprise: one or more thread locksets, each thread lockset representing locks owned by a thread in the execution; and one or more variable locksets, each variable lockset representing locks which may provide protection for a variable in the execution; and wherein generating locksets for the execution comprises: creating locksets for the execution; and modifying content of the locksets according to program statements in the execution, wherein modifying the content of the locksets according to program statements comprises, for at least some program statements in a current thread which do not involve accesses to a variable, adding locks from a lockset of the current thread to the variable lockset; and analyzing the generated locksets for the execution to determine a set of data race variables in the program, wherein, for each variable in the set of data race variables, the execution of the program involves a data race on the variable.