Patent ID: 8887167

Claim:
A computer program product comprising: a computer readable storage medium; and computer usable code stored on the computer readable storage medium, where, if executed by a processor, the computer usable code causes a computer to: conduct a runtime analysis of a multi-threaded execution environment including a first thread and a second thread; identify a context-based lock condition based on the runtime analysis and a threshold, wherein the threshold is to include at least one of a wait time threshold and an occurrence threshold, and the context-based lock condition is to include a lock redundancy component and an execution context component; detect a request issued by the first thread to acquire a lock held by the second thread, wherein the lock is associated with a shared resource in the multi-threaded execution environment; deny the request if both the lock redundancy component and the execution context component are satisfied to permit access to the shared resource by the first thread without acquiring any lock for the shared resource; and grant the request if both the lock redundancy component and the execution context component are not satisfied.