com.threerings.presents.util
Class FutureResult.Sync

java.lang.Object
  extended by java.util.concurrent.locks.AbstractOwnableSynchronizer
      extended by java.util.concurrent.locks.AbstractQueuedSynchronizer
          extended by com.threerings.presents.util.FutureResult.Sync
All Implemented Interfaces:
Serializable
Enclosing class:
FutureResult<V>

protected class FutureResult.Sync
extends AbstractQueuedSynchronizer

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer
AbstractQueuedSynchronizer.ConditionObject
 
Field Summary
protected  Throwable _exception
          The exception to throw from get()
protected  V _result
          The result to return from get()
protected static int CANCELLED
           
protected static int RAN
           
protected static int RUNNING
           
 
Constructor Summary
protected FutureResult.Sync()
           
 
Method Summary
 boolean innerCancel(boolean mayInterruptIfRunning)
           
 V innerGet()
           
 V innerGet(long nanosTimeout)
           
 boolean innerIsCancelled()
           
 boolean innerIsDone()
           
 void innerSet(V v)
           
 void innerSetException(Throwable t)
           
protected  boolean ranOrCancelled(int state)
           
protected  int tryAcquireShared(int ignore)
           
protected  boolean tryReleaseShared(int ignore)
           
 
Methods inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer
acquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, compareAndSetState, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getState, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedThreads, hasWaiters, isHeldExclusively, isQueued, owns, release, releaseShared, setState, toString, tryAcquire, tryAcquireNanos, tryAcquireSharedNanos, tryRelease
 
Methods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer
getExclusiveOwnerThread, setExclusiveOwnerThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_result

protected V _result
The result to return from get()


_exception

protected Throwable _exception
The exception to throw from get()


RUNNING

protected static final int RUNNING
See Also:
Constant Field Values

RAN

protected static final int RAN
See Also:
Constant Field Values

CANCELLED

protected static final int CANCELLED
See Also:
Constant Field Values
Constructor Detail

FutureResult.Sync

protected FutureResult.Sync()
Method Detail

innerIsCancelled

public boolean innerIsCancelled()

innerIsDone

public boolean innerIsDone()

innerGet

public V innerGet()
           throws InterruptedException,
                  ExecutionException
Throws:
InterruptedException
ExecutionException

innerGet

public V innerGet(long nanosTimeout)
           throws InterruptedException,
                  ExecutionException,
                  TimeoutException
Throws:
InterruptedException
ExecutionException
TimeoutException

innerSet

public void innerSet(V v)

innerSetException

public void innerSetException(Throwable t)

innerCancel

public boolean innerCancel(boolean mayInterruptIfRunning)

tryAcquireShared

protected int tryAcquireShared(int ignore)
Overrides:
tryAcquireShared in class AbstractQueuedSynchronizer

tryReleaseShared

protected boolean tryReleaseShared(int ignore)
Overrides:
tryReleaseShared in class AbstractQueuedSynchronizer

ranOrCancelled

protected boolean ranOrCancelled(int state)