vendor/bundle/ruby/1.8/gems/work_queue-1.0.0/lib/work_queue.rb
def spawn_thread
    if cur_threads < max_threads and @tasks.num_waiting <= 0 and cur_tasks > 0
      @threads_lock.synchronize {
        @threads << Thread.new do
          begin
            work()
          ensure
            @threads_lock.synchronize { @threads.delete(Thread.current) }
          end
        end
      }
    end
  end
##
# Enrolls a new worker thread.
# The request is only carried out if necessary.
#
Enrolls a new worker thread.
The request is only carried out if necessary.
Enrolls a new worker thread . The request is only carried out if necessary .
def spawn_thread
    if cur_threads < max_threads and @tasks.num_waiting <= 0 and cur_tasks > 0
      @threads_lock.synchronize {
        @threads << Thread.new do
          begin
            work()
          ensure
            @threads_lock.synchronize { @threads.delete(Thread.current) }
          end
        end
      }
    end
  end
def spawn_thread if cur_threads < max_threads and @tasks . num_waiting <= 0 and cur_tasks > 0 @threads_lock . synchronize { @threads << Thread . new do begin work ( ) ensure @threads_lock . synchronize { @threads . delete ( Thread . current ) } end end } end end
Enrolls a new worker thread.
Enrolls a new worker thread .