Class: Integer

Inherits:
Object show all
Defined in:
lib/minitest/test_task.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#threads_do(jobs) ⇒ Object

:nodoc:



296
297
298
299
300
301
302
303
304
305
306
# File 'lib/minitest/test_task.rb', line 296

def threads_do jobs # :nodoc:
  q = Work.new jobs

  Array.new(self) {
    Thread.new do
      while job = q.pop # go until quit value
        yield job
      end
    end
  }.each(&:join)
end