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.
1 parent 0bd6a48 commit ad0347fCopy full SHA for ad0347f
lib/concurrent/atomic/thread_local_var.rb
@@ -87,6 +87,25 @@ def bind(value, &block)
87
def allocate_storage
88
raise NotImplementedError
89
end
90
+
91
+ private
92
93
+ # This exists only for use in testing
94
+ # @!visibility private
95
+ def value_for(thread)
96
+ if array = thread.thread_variable_get(:__threadlocal_array__)
97
+ value = array[@index]
98
+ if value.nil?
99
+ @default
100
+ elsif value.equal?(NIL_SENTINEL)
101
+ nil
102
+ else
103
+ value
104
+ end
105
106
107
108
109
110
111
# @!visibility private
0 commit comments