提交 faf83640 编写于 作者: J Joshua Peek

Defining a new method is atomic, no mutex needed.

上级 0b22a96b
......@@ -4,10 +4,6 @@ module ActionView
module Renderable #:nodoc:
extend ActiveSupport::Memoizable
def self.included(base)
@@mutex = Mutex.new
end
def filename
'compiled-template'
end
......@@ -64,10 +60,8 @@ def method_name(local_assigns)
def compile(local_assigns)
render_symbol = method_name(local_assigns)
@@mutex.synchronize do
if recompile?(render_symbol)
compile!(render_symbol, local_assigns)
end
if recompile?(render_symbol)
compile!(render_symbol, local_assigns)
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册