diff options
author | Nick <nick@nicksieger.com> | 2008-04-19 14:42:56 -0500 |
---|---|---|
committer | Nick Sieger <nick@nicksieger.com> | 2008-08-29 14:12:09 -0500 |
commit | cab76ce6ac2983f59451e2d53b23746a2873aea0 (patch) | |
tree | 9aeb8c88ac13d353660d147fb82e6b865700f45a /activesupport/lib/active_support | |
parent | 50cd4bdc99ebaf3ac879e4e7fea43c5b55ca5f68 (diff) | |
download | rails-cab76ce6ac2983f59451e2d53b23746a2873aea0.tar.gz rails-cab76ce6ac2983f59451e2d53b23746a2873aea0.tar.bz2 rails-cab76ce6ac2983f59451e2d53b23746a2873aea0.zip |
Add synchronization to connection pool also
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/synchronization.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/synchronization.rb b/activesupport/lib/active_support/core_ext/module/synchronization.rb index 7d54d496ab..6253594dfa 100644 --- a/activesupport/lib/active_support/core_ext/module/synchronization.rb +++ b/activesupport/lib/active_support/core_ext/module/synchronization.rb @@ -18,7 +18,7 @@ class Module raise ArgumentError, "Synchronization needs a mutex. Supply an options hash with a :with key as the last argument (e.g. synchronize :hello, :with => :@mutex)." end - methods.each do |method| + methods.flatten.each do |method| aliased_method, punctuation = method.to_s.sub(/([?!=])$/, ''), $1 if instance_methods.include?("#{aliased_method}_without_synchronization#{punctuation}") raise ArgumentError, "#{method} is already synchronized. Double synchronization is not currently supported." @@ -26,7 +26,7 @@ class Module module_eval(<<-EOS, __FILE__, __LINE__) def #{aliased_method}_with_synchronization#{punctuation}(*args, &block) #{with}.synchronize do - #{aliased_method}_without_synchronization#{punctuation}(*args,&block) + #{aliased_method}_without_synchronization#{punctuation}(*args, &block) end end EOS |