Method: Fluent::PluginHelper::Thread#terminate

Defined in:
lib/fluent/plugin_helper/thread.rb

#terminateObject



164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/fluent/plugin_helper/thread.rb', line 164

def terminate
  super
  @_threads_mutex.synchronize{ @_threads.keys }.each do |obj_id|
    thread = @_threads[obj_id]
    log.warn "killing existing thread", thread: thread
    thread.kill if thread
  end
  @_threads_mutex.synchronize{ @_threads.keys }.each do |obj_id|
    thread = @_threads[obj_id]
    thread.join
    @_threads_mutex.synchronize{ @_threads.delete(obj_id) }
  end
  @_thread_wait_seconds = nil
end