module ActiveSupport::Dependencies

Public Class Methods

load_interlock() { || ... } Show source
# File activesupport/lib/active_support/dependencies.rb, line 39
def self.load_interlock
  Dependencies.interlock.loading { yield }
end

Execute the supplied block while holding an exclusive lock, preventing any other thread from being inside a run_interlock block at the same time.

run_interlock() { || ... } Show source
# File activesupport/lib/active_support/dependencies.rb, line 32
def self.run_interlock
  Dependencies.interlock.running { yield }
end

Execute the supplied block without interference from any concurrent loads.

unload_interlock() { || ... } Show source
# File activesupport/lib/active_support/dependencies.rb, line 46
def self.unload_interlock
  Dependencies.interlock.unloading { yield }
end

Execute the supplied block while holding an exclusive lock, preventing any other thread from being inside a run_interlock block at the same time.

© 2004–2019 David Heinemeier Hansson
Licensed under the MIT License.