|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.scheduler.SoftLatch
public class SoftLatch
An implementation of a latch using monitors. This essentially gives you park/unpark functionality. It can also be used like the Win32-style AutoResetEvent or ManualResetEvent.
Park/unpark example: use open() to unpark and waitAndClose() to park.
AutoResetEvent example: use open() to set, close() to reset, and waitAndClose() to wait.
ManualResetEvent example: use open() to set, close() to reset, and wait() to wait.
Note: never synchronize on instances of this class.
Field Summary | |
---|---|
private boolean |
open
|
Constructor Summary | |
---|---|
SoftLatch(boolean open)
Create a new latch, with the given open/closed state. |
Method Summary | |
---|---|
void |
await()
Wait for the latch to become open. |
void |
close()
Close the latch, causing future calls to wait() or waitAndClose() to block. |
void |
open()
Open the latch and let all of the thread(s) waiting on it through. |
void |
waitAndClose()
Wait for the latch to become open, and then close it and return. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean open
Constructor Detail |
---|
public SoftLatch(boolean open)
Method Detail |
---|
public void open()
public void close()
public void await()
public void waitAndClose()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |