Exemplo n.º 1
0
 Object doGet(Ref ref) {
   if (!info.running()) throw retryex;
   if (vals.containsKey(ref)) return vals.get(ref);
   try {
     ref.lock.readLock().lock();
     if (ref.tvals == null) throw new IllegalStateException(ref.toString() + " is unbound.");
     Ref.TVal ver = ref.tvals;
     do {
       if (ver.point <= readPoint) return ver.val;
     } while ((ver = ver.prior) != ref.tvals);
   } finally {
     ref.lock.readLock().unlock();
   }
   // no version of val precedes the read point
   ref.faults.incrementAndGet();
   throw retryex;
 }