public class ReclosableLatch extends AbstractQueuedSynchronizer
AbstractQueuedSynchronizer
.
This implementation allows you to create a latch with a default state (open or closed), and repeatedly open or close
the latch.AbstractQueuedSynchronizer.ConditionObject
Constructor and Description |
---|
ReclosableLatch() |
ReclosableLatch(boolean defaultOpen) |
Modifier and Type | Method and Description |
---|---|
void |
await() |
boolean |
await(long time,
TimeUnit unit) |
void |
awaitUninterruptibly() |
void |
close() |
boolean |
isOpened() |
void |
open() |
String |
toString() |
int |
tryAcquireShared(int ignored) |
boolean |
tryReleaseShared(int state) |
acquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, compareAndSetState, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getState, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedPredecessors, hasQueuedThreads, hasWaiters, isHeldExclusively, isQueued, owns, release, releaseShared, setState, tryAcquire, tryAcquireNanos, tryAcquireSharedNanos, tryRelease
getExclusiveOwnerThread, setExclusiveOwnerThread
public ReclosableLatch()
public ReclosableLatch(boolean defaultOpen)
public final int tryAcquireShared(int ignored)
tryAcquireShared
in class AbstractQueuedSynchronizer
public final boolean tryReleaseShared(int state)
tryReleaseShared
in class AbstractQueuedSynchronizer
public final void open()
public final void close()
public boolean isOpened()
public final void await() throws InterruptedException
InterruptedException
public final void awaitUninterruptibly()
public final boolean await(long time, TimeUnit unit) throws InterruptedException
InterruptedException
public String toString()
toString
in class AbstractQueuedSynchronizer
Copyright © 2014. All rights reserved.