class RSpec::Core::MemoizedHelpers::ThreadsafeMemoized
@private
def fetch_or_store(key)
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
def initialize
def initialize @memoized = {} @mutex = Support::ReentrantMutex.new end