Class SinglePermitSemaphore


  • public class SinglePermitSemaphore
    extends java.lang.Object
    A semaphore that behaves as if there was exactly one permit that can be acquired.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void acquire()
      Acquires the permit.
      void release()
      Releases a permit.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SinglePermitSemaphore

        public SinglePermitSemaphore()
    • Method Detail

      • acquire

        public void acquire()
                     throws java.lang.InterruptedException
        Acquires the permit.
        Throws:
        java.lang.InterruptedException
      • release

        public void release()
        Releases a permit.