# File lib/fluent/process.rb, line 387 def initialize @finished = false @mutex = Mutex.new @cond = ConditionVariable.new end
# File lib/fluent/process.rb, line 412 def finished? @finished end
# File lib/fluent/process.rb, line 401 def stop return if @finished @finished = true # Creating new thread due to mutex can't lock in main thread during trap context Thread.new { @mutex.synchronize do @cond.broadcast end }.run end
# File lib/fluent/process.rb, line 393 def wait @mutex.synchronize do until @finished @cond.wait(@mutex, 1.0) end end end