module Fluent::PluginHelper::EventLoop

def shutdown

def shutdown
  @_event_loop_mutex.synchronize do
    @_event_loop_attached_watchers.reverse.each do |w|
      if w.attached?
        begin
          w.detach
        rescue => e
          log.warn "unexpected error while detaching event loop watcher", error: e
        end
      end
    end
  end
  super
end