|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Latch
A structure that can be used as a waiting point (just like a Future or a
CountDownLatch. As long as it is closed, the waiting thread block (unless it is
interrupted or a timeout occurs). As soon as it opens, all waiting threads are woken up and continue.
Threads that call the wait after the Latch is opened, can continue. Once the Latch has been opened, it can
never be closed.
| 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. |
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 |
tryAwaitNs(long timeoutNs)
|
boolean |
tryAwaitUninterruptible(long timeout,
java.util.concurrent.TimeUnit unit)
|
boolean |
tryAwaitUninterruptibleNs(long timeout)
|
| Method Detail |
|---|
void open()
boolean isOpen()
void await()
throws java.lang.InterruptedException
java.lang.InterruptedException - if the calling thread is interrupted while waiting.void awaitUninterruptible()
java.lang.UnsupportedOperationException - if the implementation doesn't support this functionality.
boolean tryAwait(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
timeout - the maximum time to wait.unit - the TimeUnit the timeout is expressed in
java.lang.InterruptedException - if the calling thread is interrupted while waiting.
java.lang.NullPointerException - if unit is null
java.lang.UnsupportedOperationException - if the implementation doesn't support this functionality.
boolean tryAwaitNs(long timeoutNs)
throws java.lang.InterruptedException
java.lang.InterruptedException
boolean tryAwaitUninterruptible(long timeout,
java.util.concurrent.TimeUnit unit)
boolean tryAwaitUninterruptibleNs(long timeout)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||