Module: Latch::Mixin

Extended by:
Mixin
Included in:
Mixin
Defined in:
lib/latch.rb

Instance Method Summary collapse

Instance Method Details

#latch(count = 1, timeout = nil, &block) ⇒ Object

Syntactic sugar!



7
8
9
10
11
# File 'lib/latch.rb', line 7

def latch(count = 1, timeout = nil, &block)
  l = Latch.new(count)
  block.call(l)
  l.await(timeout)
end