class Parapool::Synchronizer
Public Class Methods
new(count)
click to toggle source
Calls superclass method
# File lib/parapool/synchronizer.rb, line 7 def initialize(count) super() @count = count @completed = new_cond end
Public Instance Methods
count()
click to toggle source
# File lib/parapool/synchronizer.rb, line 15 def count synchronize do @count -= 1 @completed.broadcast end self end
wait()
click to toggle source
# File lib/parapool/synchronizer.rb, line 25 def wait synchronize do @completed.wait_until { @count.zero? } end self end