def []=(key, value)
      ObjectSpace.define_finalizer(value, @reference_cleanup)
      key = key.dup if key.is_a?(String)
      @lock.synchronize do
        @references[key] = self.class.reference_class.new(value)
        keys_for_id = @references_to_keys_map[value.__id__]
        unless keys_for_id
          keys_for_id = []
          @references_to_keys_map[value.__id__] = keys_for_id
        end
        keys_for_id << key
      end
      value
    end
def []=(key, value)
      ObjectSpace.define_finalizer(value, @reference_cleanup)
      key = key.dup if key.is_a?(String)
      @lock.synchronize do
        @references[key] = self.class.reference_class.new(value)
        keys_for_id = @references_to_keys_map[value.__id__]
        unless keys_for_id
          keys_for_id = []
          @references_to_keys_map[value.__id__] = keys_for_id
        end
        keys_for_id << key
      end
      value
    end
Add a key/value to the map.