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

Revert "Ivar += in MRI is thread safe"

This reverts commit dd1aa73889.

Since this ivar is updated in a synchronize block just below,
and has to be protected from other threads

Co-authored-by: Ryuta Kamizono <kamipo@gmail.com>
This commit is contained in:
Akira Matsuda 2020-06-05 00:46:02 +09:00
parent c76987503a
commit c42b355c39

View file

@ -822,12 +822,8 @@ module ActiveRecord
end end
def with_new_connections_blocked def with_new_connections_blocked
if RUBY_ENGINE == "ruby" synchronize do
@threads_blocking_new_connections += 1 @threads_blocking_new_connections += 1
else
synchronize do
@threads_blocking_new_connections += 1
end
end end
yield yield