resque/resque-scheduler — pull request #253 by ktheory (2013-09-18 17:22:36+00:00)
Title: Shutdown gracefully in ruby 2.0.0.

Fixes issue #228.

Avoid `ThreadError: can't be called from trap context` on shutdown.

Using mutexes inside traps is deadlockable and prohibited in ruby 2.0.
Instead, do the work in a seperate thread.

See discussion at https://bugs.ruby-lang.org/issues/7917