Method: ThreadsWait.all_waits

Defined in:
lib/thwait.rb

.all_waits(*threads) ⇒ Object

Waits until all specified threads have terminated. If a block is provided, it is executed for each thread as they terminate.



37
38
39
40
41
42
43
44
45
46
# File 'lib/thwait.rb', line 37

def ThreadsWait.all_waits(*threads) # :yield: thread
  tw = ThreadsWait.new(*threads)
  if block_given?
    tw.all_waits do |th|
      yield th
    end
  else
    tw.all_waits
  end
end