43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/fluent/plugin_helper/thread.rb', line 43
def thread_wait_until_stop
timeout_at = Fluent::Clock.now + THREAD_SHUTDOWN_HARD_TIMEOUT_IN_TESTS
until @_threads_mutex.synchronize{ @_threads.values.reduce(true){|r,t| r && !t[:_fluentd_plugin_helper_thread_running] } }
break if Fluent::Clock.now > timeout_at
sleep 0.1
end
@_threads_mutex.synchronize{ @_threads.values }.each do |t|
if t.alive?
puts "going to kill the thread still running: #{t[:_fluentd_plugin_helper_thread_title]}"
t.kill rescue nil
t[:_fluentd_plugin_helper_thread_running] = false
end
end
end
|