package saker.util.thread
public interface BooleanLatch
A single-fire boolean latch synchronization interface.
The interface describes a single-use boolean latch, which can be signalled once that in turn causes all waiters to be released.
The interface is mainly based on the BooleanLatch
example code described in the documentation of
AbstractQueuedSynchronizer.
saker.util 0.8.4
public void | await() Waits for the latch to be signalled. |
public boolean | Waits for the lats to be signalled or until the given timeout elapses. |
public void | Waits for the latch to be signalled in non interruptible mode. |
public boolean | awaitUninterruptibly( Waits for the lats to be signalled or until the given timeout elapses in non interruptible mode. |
public boolean | Gets if the latch has been signalled. |
public static BooleanLatch | Creates a new boolean latch. |
public void | signal() Signals the latch and releases all waiters. |
Waits for the latch to be signalled.
If the latch is already signalled when this method is entered, it will return immediately, and will not throw InterruptedException even if the current thread is interrupted.
InterruptedExceptionIf the current thread is interrupted during waiting.
Waits for the lats to be signalled or until the given timeout elapses.
If the latch is already signalled when this method is entered, it will return immediately, and will not throw InterruptedException even if the current thread is interrupted.
timeoutThe timeout amount.
unitThe unit if the amount.
true
if the latch has been signalled, false
if the timeout elapsed.InterruptedExceptionIf the current thread is interrupted during waiting.
Waits for the latch to be signalled in non interruptible mode.
Waits for the lats to be signalled or until the given timeout elapses in non interruptible mode.
timeoutThe timeout amount.
unitThe unit if the amount.
true
if the latch has been signalled, false
if the timeout elapsed.Gets if the latch has been signalled.
true
if the latch is signalled.Creates a new boolean latch.
The new latch.
Signals the latch and releases all waiters.