|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.multiverse.utils.latches.CheapLatch
public final class CheapLatch
A Latch based on the intrinsic lock and uses the minimal amount of resources. It uses the CheapLatch object
itself for the monitor lock. It can't do any timed waits.
Lock because it supports timed waits.
| Field Summary | |
|---|---|
static CheapLatch |
OPEN_LATCH
|
| Constructor Summary | |
|---|---|
CheapLatch()
Creates a new closed CheapLatch. |
|
CheapLatch(boolean isOpen)
Creates a new CheapLatch. |
|
| 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)
This operation is not supported on the CheapLatch. |
boolean |
tryAwaitUninterruptible(long timeout,
java.util.concurrent.TimeUnit unit)
This operation is not supported on the CheapLatch. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final CheapLatch OPEN_LATCH
| Constructor Detail |
|---|
public CheapLatch()
public CheapLatch(boolean isOpen)
isOpen - true if the latch already is closed, false if the latch is closed.| 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 Latchpublic void open()
Latch
open in interface Latch
public boolean tryAwait(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
tryAwait in interface Latchtimeout - the maximum time to wait.unit - the TimeUnit the timeout is expressed in
java.lang.UnsupportedOperationException - because timed waits are not supported by this CheapLatch.
java.lang.InterruptedException - if the calling thread is interrupted while waiting.
public boolean tryAwaitUninterruptible(long timeout,
java.util.concurrent.TimeUnit unit)
tryAwaitUninterruptible in interface Latchjava.lang.UnsupportedOperationException - because timed waits are not supported by this CheapLatch.public 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 | |||||||||