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:


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

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