ActiveSupport::Dependencies

module ActiveSupport::Dependencies

Public Class Methods

load_interlock() { || ... } Show source

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

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

Execute the supplied block without interference from any concurrent loads.

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

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

# File activesupport/lib/active_support/dependencies.rb, line 42
def self.unload_interlock
  Dependencies.interlock.unloading { yield }
end

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

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部