void removed(String refName) { RefCache oldCache, newCache; do { oldCache = cache.get(); if (oldCache == null) return; newCache = oldCache.remove(refName); } while (!cache.compareAndSet(oldCache, newCache)); }
void stored(Ref ref) { RefCache oldCache, newCache; do { oldCache = cache.get(); if (oldCache == null) return; newCache = oldCache.put(ref); } while (!cache.compareAndSet(oldCache, newCache)); }