def defer(callable=nil, &blk)
      callable ||= blk

      raise ArgumentError, "Argument to Threadpool#defer must respond_to?(:call)" unless callable.respond_to?(:call)

      @mutex.lock
      begin
        @queue << callable
        @cond.broadcast
      ensure
        @mutex.unlock rescue nil
      end

      nil
    end
def defer(callable=nil, &blk)
      callable ||= blk

      raise ArgumentError, "Argument to Threadpool#defer must respond_to?(:call)" unless callable.respond_to?(:call)

      @mutex.lock
      begin
        @queue << callable
        @cond.broadcast
      ensure
        @mutex.unlock rescue nil
      end

      nil
    end
Queue an operation to be run on an internal threadpool. You may either
 provide an object that responds_to?(:call) or pass a block. There is no
 mechanism for retrieving the result of the operation, it is purely
 fire-and-forget, so the user is expected to make arrangements for this in
 their code.