class ActiveSupport::Dependencies::Interlock

def loading

def loading
  @lock.exclusive(purpose: :load, compatible: [:load], after_compatible: [:load]) do
    yield
  end
end