Patent ID: 8201179

Claim:
A method for controlling sharing of resources in a multi-threaded environment, comprising: entering a finite state machine state sequence; controlling resource-sharing threads using the finite state machine state sequence; employing state sharing in the finite state machine state sequence, which comprises: a plurality of control states, wherein only one thread, a privileged thread, has complete ownership of a control state; and a plurality of ownership transfer states, wherein a plurality of threads each has ownership of an ownership transfer state; exiting the finite state machine state sequence when shared resource control is complete; providing a wake mode of a thread, wherein the thread checks for ownership of a current state of the finite state machine state sequence, wherein the wake mode further comprises: a non-ownership of the current state of the finite state machine state sequence by a thread, wherein the thread relinquishes control of the finite state machine; and an ownership of the current state of the finite state machine state sequence by a thread, comprising: performing of a control operation by the thread; and updating of the current state; and providing a sleep mode of a thread, wherein the thread is inactive.