Class AdjustableSemaphore


  • @ThreadSafe
    public final class AdjustableSemaphore
    extends java.lang.Object
    A simple implementation of an adjustable semaphore.
    • Constructor Summary

      Constructors 
      Constructor Description
      AdjustableSemaphore​(int initialPermits)
      Create a new adjustable semaphore with the given number of initial permits.
    • Method Summary

      • Methods inherited from class java.lang.Object

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

      • AdjustableSemaphore

        public AdjustableSemaphore​(int initialPermits)
        Create a new adjustable semaphore with the given number of initial permits.
        Parameters:
        initialPermits - the initial number of permits, must be at least 1