We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 31669c6 + c4cbc96 commit 63a6907Copy full SHA for 63a6907
lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb
@@ -97,7 +97,10 @@ def self.thread_local_finalizer(index)
97
# The cost of GC'ing a TLV is linear in the number of threads using TLVs
98
# But that is natural! More threads means more storage is used per TLV
99
# So naturally more CPU time is required to free more storage
100
- THREAD_LOCAL_ARRAYS.each_value { |array| array[index] = nil }
+ #
101
+ # DO NOT use each_value which might conflict with new pair assignment
102
+ # into the hash in #value= method
103
+ THREAD_LOCAL_ARRAYS.values.each { |array| array[index] = nil }
104
# free index has to be published after the arrays are cleared
105
FREE.push(index)
106
end
0 commit comments