def shutdown(timeout=5)
#       logger.debug { "#{self.class}##{__method__}" }

      @mutex.lock
      begin
        return true if @state == :shutdown

        @state = :shutdown
        @cond.broadcast
      ensure
        @mutex.unlock rescue nil
      end

      return true unless @thread 

      unless @thread.join(timeout) == @thread
        logger.error { "#{self.class} timed out waiting for dispatch thread, callback: #{callback.inspect}" }
        return false
      end

      true
    end
def shutdown(timeout=5)
#       logger.debug { "#{self.class}##{__method__}" }

      @mutex.lock
      begin
        return true if @state == :shutdown

        @state = :shutdown
        @cond.broadcast
      ensure
        @mutex.unlock rescue nil
      end

      return true unless @thread 

      unless @thread.join(timeout) == @thread
        logger.error { "#{self.class} timed out waiting for dispatch thread, callback: #{callback.inspect}" }
        return false
      end

      true
    end
how long to wait on thread shutdown before we return