@private
# File lib/rspec/core/memoized_helpers.rb, line 149 def initialize @memoized = {} @mutex = Support::ReentrantMutex.new end
# File lib/rspec/core/memoized_helpers.rb, line 154 def fetch_or_store(key) @memoized.fetch(key) do # only first access pays for synchronization @mutex.synchronize do @memoized.fetch(key) { @memoized[key] = yield } end end end