摘要 |
Methods and apparatus for implementing an atomic monitor wait operation are disclosed. According to one aspect of the present invention, a computer-implemented method for implementing an atomic monitor wait operation includes creating a semaphore specific to a first thread. The semaphore is then placed in a wait queue associated with an object whose object lock is owned by the first thread in order to, in one implementation, preserve queue order. The first thread then exits a monitor associated with the object by, in one embodiment, releasing the object lock. The first thread then suspends execution until the semaphore receives notification that the object lock is available.
|