Package org.jgroups.blocks.executor
Class ExecutionService.DistributedFuture.Sync<V>
java.lang.Object
java.util.concurrent.locks.AbstractOwnableSynchronizer
java.util.concurrent.locks.AbstractQueuedSynchronizer
org.jgroups.blocks.executor.ExecutionService.DistributedFuture.Sync<V>
- All Implemented Interfaces:
Serializable
- Enclosing class:
ExecutionService.DistributedFuture<V>
protected static final class ExecutionService.DistributedFuture.Sync<V>
extends AbstractQueuedSynchronizer
Synchronization control for FutureTask. Note that this must be
a non-static inner class in order to invoke the protected
done method. For clarity, all inner class support
methods are same as outer, prefixed with "inner".
Uses AQS sync state to represent run status
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer
AbstractQueuedSynchronizer.ConditionObject -
Field Summary
FieldsModifier and TypeFieldDescriptionThe underlying callableprotected static final intState value representing that task was cancelledprotected ThrowableThe exception to throw from get()protected final ExecutionService.DistributedFuture<V> The containing futureprotected static final intState value representing that task ranprotected VThe result to return from get()protected ThreadThe thread running task.protected static final intState value representing that task is running -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected inttryAcquireShared(int ignore) Implements AQS base acquire to succeed if ran or cancelledprotected booleantryReleaseShared(int ignore) Implements AQS base release to always signal after setting final done status by nulling runner thread.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, tryReleaseMethods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer
getExclusiveOwnerThread, setExclusiveOwnerThread
-
Field Details
-
RUNNING
protected static final int RUNNINGState value representing that task is running- See Also:
-
RAN
protected static final int RANState value representing that task ran- See Also:
-
CANCELLED
protected static final int CANCELLEDState value representing that task was cancelled- See Also:
-
future
The containing future -
callable
The underlying callable -
result
The result to return from get() -
exception
The exception to throw from get() -
runner
The thread running task. When nulled after set/cancel, this indicates that the results are accessible. Must be volatile, to ensure visibility upon completion.
-
-
Constructor Details
-
Sync
-
-
Method Details