1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

No need to synchronize for just reading an ivar, at least in MRI

thanks to GVL.
This commit is contained in:
Akira Matsuda 2019-09-01 11:37:18 +09:00
parent 2c528dd446
commit ea791e53f9

View file

@ -215,9 +215,15 @@ module ActionDispatch # :nodoc:
end
end
def sending?; synchronize { @sending }; end
def committed?; synchronize { @committed }; end
def sent?; synchronize { @sent }; end
if defined?(JRUBY_VERSION)
def sending?; synchronize { @sending }; end
def committed?; synchronize { @committed }; end
def sent?; synchronize { @sent }; end
else
def sending?; @sending; end
def committed?; @committed; end
def sent?; @sent; end
end
# Sets the HTTP status code.
def status=(status)