def add_jobs(jobs)
      raise PoolClosed.new("Pool #{self} is currently closed") if pool_closed?
      raise ArgumentError.new("Expecting an array but received: #{jobs.class}") unless jobs.is_a?(Array)
      @queue.pause
      begin
        jobs.each do |job|
          case job
          when Proc
            @queue << [job, []]
          when Array
            raise ArgumentError.new('Jobs to be processed by the pool must be a proc/lambda or [proc/lambda, [*args]]') unless job.size == 2 and job[0].is_a?(Proc) and job[1].is_a?(Array)
            @queue << [job.shift, job]
          else
            raise ArgumentError.new('Jobs to be processed by the pool must be a proc/lambda or [proc/lambda, [*args]]')
          end
        end
      ensure
        num = jobs.size - @threads.select{|t|t.waiting?}.size
        @lock.synchronize{ num.times{ create_thread(:nowait) } if num > 0 }
        @queue.unpause
      end
      true
    end
def add_jobs(jobs)
      raise PoolClosed.new("Pool #{self} is currently closed") if pool_closed?
      raise ArgumentError.new("Expecting an array but received: #{jobs.class}") unless jobs.is_a?(Array)
      @queue.pause
      begin
        jobs.each do |job|
          case job
          when Proc
            @queue << [job, []]
          when Array
            raise ArgumentError.new('Jobs to be processed by the pool must be a proc/lambda or [proc/lambda, [*args]]') unless job.size == 2 and job[0].is_a?(Proc) and job[1].is_a?(Array)
            @queue << [job.shift, job]
          else
            raise ArgumentError.new('Jobs to be processed by the pool must be a proc/lambda or [proc/lambda, [*args]]')
          end
        end
      ensure
        num = jobs.size - @threads.select{|t|t.waiting?}.size
        @lock.synchronize{ num.times{ create_thread(:nowait) } if num > 0 }
        @queue.unpause
      end
      true
    end
jobs:: Array of proc/lambdas
 Will queue a list of jobs into the pool