Class: Integer

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

Instance Method Summary collapse

Instance Method Details

#threads_do(jobs) ⇒ Object

:nodoc:



302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/minitest/test_task.rb', line 302

def threads_do(jobs) # :nodoc:
  require "thread"
  q = Work.new jobs

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