def get_or_create(key)
      @lock.synchronize do
        if @store.include?(key)
          @store[key]
        elsif block_given?
          @store[key] = yield
        else
          # XXX don't expose the receiver as this class is an internal
          # implementation detail
          raise Wireless::KeyError.new(
            "#{@type} not found: #{key}",
            key: key
          )
        end
      end
    end
def get_or_create(key)
      @lock.synchronize do
        if @store.include?(key)
          @store[key]
        elsif block_given?
          @store[key] = yield
        else
          # XXX don't expose the receiver as this class is an internal
          # implementation detail
          raise Wireless::KeyError.new(
            "#{@type} not found: #{key}",
            key: key
          )
        end
      end
    end
Retrieve a value from the store. If it doesn't exist and a block is
 supplied, create and return it; otherwise, raise a KeyError.

 A synchronized version of:

   store[key] ||= value