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