lib/deimos/producer.rb in deimos-ruby-1.0.0.pre.beta24 vs lib/deimos/producer.rb in deimos-ruby-1.0.0.pre.beta25

- old
+ new

@@ -23,12 +23,15 @@ if Thread.current[:frk_disable_all_producers] # nested disable block yield return end - Thread.current[:frk_disable_all_producers] = true - yield - Thread.current[:frk_disable_all_producers] = false + begin + Thread.current[:frk_disable_all_producers] = true + yield + ensure + Thread.current[:frk_disable_all_producers] = false + end end # :nodoc: def _disable_producer_classes(producer_classes) Thread.current[:frk_disabled_producers] ||= Set.new