Method: Async::Semaphore#release
- Defined in:
- lib/async/semaphore.rb
#release ⇒ Object
Release the semaphore. Must match up with a corresponding call to ‘acquire`. Will release waiting fibers in FIFO order.
87 88 89 90 91 92 93 94 95 |
# File 'lib/async/semaphore.rb', line 87 def release @count -= 1 while (@limit - @count) > 0 and fiber = @waiting.shift if fiber.alive? fiber.resume end end end |