123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Core::MemoizedHelpers::ThreadsafeMemoized Private

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: rspec-core/lib/rspec/core/memoized_helpers.rb

Class Method Summary

Instance Method Summary

Instance Method Details

#fetch_or_store(key)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/memoized_helpers.rb', line 176

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