|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.multiverse.utils.latches.StandardLatch
public final class StandardLatch
A standard Latch implementation that supports all features of the Latch. Its implementation
is based on the Lock and Condition.
| Constructor Summary | |
|---|---|
StandardLatch()
Creates a new closed StandardLatch. |
|
StandardLatch(boolean isOpen)
Creates a new StandardLatch. |
|
| Method Summary | |
|---|---|
void |
await()
Waits for this Latch to closed. |
void |
awaitUninterruptible()
Waits for this Latch to closed and while waiting it won't be interrupted. |
boolean |
isOpen()
Return true if this Latch is closed, false otherwise. |
void |
open()
Opens the latch. |
java.lang.String |
toString()
|
boolean |
tryAwait(long timeout,
java.util.concurrent.TimeUnit unit)
Waits for this Latch to closed or till a timeout occurs or when the calling thread is interrupted. |
boolean |
tryAwaitUninterruptible(long timeout,
java.util.concurrent.TimeUnit unit)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public StandardLatch()
public StandardLatch(boolean isOpen)
isOpen - true if the latch already is closed, false otherwise.| Method Detail |
|---|
public void await()
throws java.lang.InterruptedException
Latch
await in interface Latchjava.lang.InterruptedException - if the calling thread is interrupted while waiting.public void awaitUninterruptible()
Latch
awaitUninterruptible in interface Latch
public boolean tryAwait(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
Latch
tryAwait in interface Latchtimeout - the maximum time to wait.unit - the TimeUnit the timeout is expressed in
java.lang.InterruptedException - if the calling thread is interrupted while waiting.
public boolean tryAwaitUninterruptible(long timeout,
java.util.concurrent.TimeUnit unit)
tryAwaitUninterruptible in interface Latchpublic void open()
Latch
open in interface Latchpublic boolean isOpen()
Latch
isOpen in interface Latchpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||