Patent ID: 8131983

Claim:
A computer-implemented method for performing a timeout wait for a thread requesting access to a shared resource locked by a process lock, comprising: sending, by a first thread, a timeout request message to a timeout handler process; transitioning the first thread to an indefinitely blocked state; determining, from the timeout request message, a timeout period after which the first thread should be unblocked from the indefinitely blocked state while waiting to access to the shared resource; storing the timeout request message in a minimum heap data structure configured to store a plurality of timeout request messages, wherein nodes of the minimum heap data structure store one of the plurality of timeout request messages, and wherein the minimum heap data structure is sorted based on a timeout period corresponding to each respective timeout request message; and upon determining that the timeout period has elapsed and that the first thread is still requesting access to the shared resource, sending a wakeup message to a message queue associated with the indefinitely blocked thread.