fluent/fluentd — pull request #191 by sorah (2013-09-07 06:06:08+00:00)
Title: Avoid calling Engine.flush! in trap context

Since Ruby 2.0.0, We can't synchronize mutex in trap context.

Currently USR1 handler calls `Fluent::Engine.flush!` in trap handler
(main thread) and it attempts to lock mutexes.

This separates thread to call `Fluent::Engine.flush!` to avoid that
limitation.

(Trap handlers run in main thread)

So this enables flushing via USR1 signal in Ruby 2.0.0 or later.