Class ReentrantCircuit.Sync

All Implemented Interfaces:
Serializable
Enclosing class:
ReentrantCircuit

static final class ReentrantCircuit.Sync extends AbstractQueuedSynchronizer
Synchronization state of 0 = closed, 1 = open.
  • Constructor Details

    • Sync

      Sync()
  • Method Details

    • tryReleaseShared

      public boolean tryReleaseShared(int ignored)
      Closes the circuit.
      Overrides:
      tryReleaseShared in class AbstractQueuedSynchronizer
      Parameters:
      ignored - int; release does not use the int param.
    • tryAcquireShared

      protected int tryAcquireShared(int acquires)
      Opens the circuit if not a test.
      Overrides:
      tryAcquireShared in class AbstractQueuedSynchronizer
      Parameters:
      acquires - when 0, return whether circuit is closed. When 1, open call
    • isClosed

      boolean isClosed()
      Returns:
      whether state == 0
    • open

      void open()
      set state to 1.