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
- .new ⇒ ThreadsafeMemoized constructor Internal use only
Instance Method Summary
- #fetch_or_store(key) Internal use only
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