W3cubDocs

/Ruby on Rails 7.0

class ActiveSupport::Concurrency::LoadInterlockAwareMonitor

Parent:
Monitor

A monitor that will permit dependency loading while blocked waiting for the lock.

Public Instance Methods

mon_enter() Show source
# File activesupport/lib/active_support/concurrency/load_interlock_aware_monitor.rb, line 15
def mon_enter
  mon_try_enter ||
    ActiveSupport::Dependencies.interlock.permit_concurrent_loads { super }
end

Enters an exclusive section, but allows dependency loading while blocked

Calls superclass method
synchronize(&block) Show source
# File activesupport/lib/active_support/concurrency/load_interlock_aware_monitor.rb, line 20
def synchronize(&block)
  Thread.handle_interrupt(EXCEPTION_NEVER) do
    mon_enter

    begin
      Thread.handle_interrupt(EXCEPTION_IMMEDIATE, &block)
    ensure
      mon_exit
    end
  end
end

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