×

Methods and apparatus for locking objects in a multi-threaded environment

  • US 7,209,918 B2
  • Filed: 09/24/2002
  • Issued: 04/24/2007
  • Est. Priority Date: 09/24/2002
  • Status: Active Grant
First Claim
Patent Images

1. For use in a multi-thread environment, a method of locking an object to permit a thread to exclusively execute at least a portion of a routine associated with the object, the method comprising:

  • receiving a request to access the object from a first thread;

    determining if the object is owned by the first thread;

    if the object is owned by a second thread, locking the object and setting a lock owner field to identify the first thread via an atomic execution; and

    if the object is owned by the first thread, locking the object and setting the lock owner field to identify the first thread without an atomic execution,wherein locking the object without an atomic execution comprises;

    determining if a first flag field associated with the object has a first predetermined state;

    if the first flag field has the first predetermined state, setting a second flag field associated with the object to a second predetermined state;

    verifying that the first flag field still has the first predetermined state.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×