Class: Concurrent::Semaphore

Inherits:
SemaphoreImplementation
  • Object
show all
Defined in:
lib/concurrent/atomic/semaphore.rb

Overview

A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if necessary until a permit is available, and then takes it. Each #release adds a permit, potentially releasing a blocking acquirer. However, no actual permit objects are used; the Semaphore just keeps a count of the number available and acts accordingly.

See Also:

  • MutexSemaphore