MCPcopy Index your code
hub / github.com/clojure/clojure / doGet

Method doGet

src/jvm/clojure/lang/LockingTransaction.java:397–422  ·  view source on GitHub ↗
(Ref ref)

Source from the content-addressed store, hash-verified

395}
396
397Object doGet(Ref ref){
398 if(!info.running())
399 throw retryex;
400 if(vals.containsKey(ref))
401 return vals.get(ref);
402 try
403 {
404 ref.lock.readLock().lock();
405 if(ref.tvals == null)
406 throw new IllegalStateException(ref.toString() + " is unbound.");
407 Ref.TVal ver = ref.tvals;
408 do
409 {
410 if(ver.point <= readPoint)
411 return ver.val;
412 } while((ver = ver.prior) != ref.tvals);
413 }
414 finally
415 {
416 ref.lock.readLock().unlock();
417 }
418 //no version of val precedes the read point
419 ref.faults.incrementAndGet();
420 throw retryex;
421
422}
423
424Object doSet(Ref ref, Object val){
425 if(!info.running())

Callers 2

derefMethod · 0.95
alterMethod · 0.95

Calls 5

runningMethod · 0.80
lockMethod · 0.80
containsKeyMethod · 0.65
getMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected