From 10c7f544d916f73245bdb37fde09c8cdcb2184e0 Mon Sep 17 00:00:00 2001 From: Matthew Draper Date: Thu, 23 Jul 2015 09:41:45 +0930 Subject: 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. --- activesupport/lib/active_support/dependencies.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'activesupport/lib/active_support/dependencies.rb') 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! -- cgit v1.2.3