класс ActiveSupport::Concurrency::LoadInterlockAwareMonitor
Монитор, который позволит загружать зависимости, пока происходит блокировка ожидания замка.
Публичные методы экземпляров
# 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 Входит в эксклюзивную секцию, но позволяет загружать зависимости, пока происходит блокировка.
Вызывает метод суперкласса
# File activesupport/lib/active_support/concurrency/load_interlock_aware_monitor.rb, line 20
def synchronize
Thread.handle_interrupt(EXCEPTION_NEVER) do
mon_enter
begin
Thread.handle_interrupt(EXCEPTION_IMMEDIATE) do
yield
end
ensure
mon_exit
end
end
end
© 2004–2020 David Heinemeier Hansson
Licensed under the MIT License.