Skip to content

Commit 10c7f54

Browse files
committed
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.
1 parent 6ffec3c commit 10c7f54

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

activesupport/lib/active_support/dependencies.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,10 @@ def require_dependency(file_name, message = "No such file to load -- %s")
255255
end
256256

257257
def load_dependency(file)
258-
Dependencies.load_interlock do
259-
if Dependencies.load? && ActiveSupport::Dependencies.constant_watch_stack.watching?
260-
Dependencies.new_constants_in(Object) { yield }
261-
else
262-
yield
263-
end
258+
if Dependencies.load? && ActiveSupport::Dependencies.constant_watch_stack.watching?
259+
Dependencies.new_constants_in(Object) { yield }
260+
else
261+
yield
264262
end
265263
rescue Exception => exception # errors from loading file
266264
exception.blame_file! file if exception.respond_to? :blame_file!

0 commit comments

Comments
 (0)