Patent ID: 8473969

Claim:
A method for managing a multithreaded computer system comprising: a second thread requesting ownership of a lock for a shared memory resource owned by a first thread; determining discontinuity of lock ownership by the first thread, including a first comparison of a thread identifier of the first thread with a thread identifier of the second thread, and setting a first flag in response to a determination of discontinuity of lock ownership; extending continuity of lock ownership and setting a second flag in response to confirmation of continuity of said lock operation by the first thread; and assigning ownership of the lock to the second thread by executing a first compare-and-swap operation in response to a determination that ownership of the lock by the first thread has been discontinued, including waiting until a thread denied lock ownership has passed a critical section prior to assigning ownership to the second thread, wherein a second compare-and-swap operation is initiated responsive to a changed lock ownership following the first comparison, but prior to setting a second flag, to clear the first flag and enable a lock reset.