diff options
author | Matthew Draper <matthew@trebex.net> | 2015-07-23 09:41:45 +0930 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2015-07-23 09:41:45 +0930 |
commit | 10c7f544d916f73245bdb37fde09c8cdcb2184e0 (patch) | |
tree | 4babb50fc644dcf4b31337dff27068491466c415 /activesupport | |
parent | 6ffec3c16c0ee0b0ab4643907af1f2ed80a71a9a (diff) | |
download | rails-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')
-rw-r--r-- | activesupport/lib/active_support/dependencies.rb | 10 |
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! |