Class ReentrantCircuit.Sync
java.lang.Object
java.util.concurrent.locks.AbstractOwnableSynchronizer
java.util.concurrent.locks.AbstractQueuedSynchronizer
net.jodah.concurrentunit.internal.ReentrantCircuit.Sync
- All Implemented Interfaces:
Serializable
- Enclosing class:
- ReentrantCircuit
Synchronization state of 0 = closed, 1 = open.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer
AbstractQueuedSynchronizer.ConditionObject
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) boolean
isClosed()
(package private) void
open()
set state to 1.protected int
tryAcquireShared
(int acquires) Opens the circuit if not a test.boolean
tryReleaseShared
(int ignored) Closes the circuit.Methods inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer
acquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, compareAndSetState, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getState, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedPredecessors, hasQueuedThreads, hasWaiters, isHeldExclusively, isQueued, owns, release, releaseShared, setState, toString, tryAcquire, tryAcquireNanos, tryAcquireSharedNanos, tryRelease
Methods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer
getExclusiveOwnerThread, setExclusiveOwnerThread
-
Constructor Details
-
Sync
Sync()
-
-
Method Details
-
isClosed
boolean isClosed()- Returns:
- whether state == 0
-
open
void open()set state to 1.