class Contender::SimpleThreadFactory

Attributes

group[R]

@return [ThreadGroup]

priority[RW]

@return [Integer]

Public Class Methods

new() click to toggle source

@return [undefined]

# File lib/contender/thread_factory.rb, line 20
def initialize
  @group = ThreadGroup.new
  @priority = 0
end

Public Instance Methods

create(&block) click to toggle source

@api public @yield @return [Thread]

# File lib/contender/thread_factory.rb, line 28
def create(&block)
  thread = Thread.new &block
  thread.priority = @priority

  @group.add thread

  thread
end