Class ReentrantCircuit.Sync

    • Constructor Detail

      • Sync

        Sync()
    • Method Detail

      • 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.