class

Concurrent::Semaphore

Inherits Reference / Object

A semaphore allows execution of at most n tasks simultaneously.

Constructors

new(n : Int32)

Create a semaphore for n concurrent accesses. Will raise if n <= 0.

Source

Instance methods

acquire

Acquire an item from the semaphore, calling the block, and then safely releasing the semaphore.

Source