Class Iterables.LazyReference.Sync

All Implemented Interfaces:
Serializable
Enclosing class:
Iterables.LazyReference<T>

private final class Iterables.LazyReference.Sync extends AbstractQueuedSynchronizer
Synchronization control for LazyReference. Note that this must be a non-static inner class in order to invoke the protected {code}create{/code} method. Taken from FutureTask AQS implementation and pruned to be as compact as possible. Uses AQS sync state to represent run status.
  • Field Details

    • IGNORED

      static final int IGNORED
      See Also:
    • serialVersionUID

      private static final long serialVersionUID
      only here to shut up the compiler warnings, the outer class is NOT serializable
      See Also:
    • result

      private T result
      The result to return from get()
    • exception

      private Throwable exception
      The exception to throw from get()
    • runner

      private volatile Thread 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

      private Sync()
  • Method Details