aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/dependencies.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2015-07-23 09:41:45 +0930
committerMatthew Draper <matthew@trebex.net>2015-07-23 09:41:45 +0930
commit10c7f544d916f73245bdb37fde09c8cdcb2184e0 (patch)
tree4babb50fc644dcf4b31337dff27068491466c415 /activesupport/lib/active_support/dependencies.rb
parent6ffec3c16c0ee0b0ab4643907af1f2ed80a71a9a (diff)
downloadrails-10c7f544d916f73245bdb37fde09c8cdcb2184e0.tar.gz
rails-10c7f544d916f73245bdb37fde09c8cdcb2184e0.tar.bz2
rails-10c7f544d916f73245bdb37fde09c8cdcb2184e0.zip
Don't apply locking around basic #load / #require
That's outside our remit, and dangerous... if a caller has their own locking to protect against the natural race danger, we'll deadlock against it.
Diffstat (limited to 'activesupport/lib/active_support/dependencies.rb')
-rw-r--r--activesupport/lib/active_support/dependencies.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index fc6f822969..be03f65e6e 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -255,12 +255,10 @@ module ActiveSupport #:nodoc:
end
def load_dependency(file)
- Dependencies.load_interlock do
- if Dependencies.load? && ActiveSupport::Dependencies.constant_watch_stack.watching?
- Dependencies.new_constants_in(Object) { yield }
- else
- yield
- end
+ if Dependencies.load? && ActiveSupport::Dependencies.constant_watch_stack.watching?
+ Dependencies.new_constants_in(Object) { yield }
+ else
+ yield
end
rescue Exception => exception # errors from loading file
exception.blame_file! file if exception.respond_to? :blame_file!