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

Method swapVals

src/jvm/clojure/lang/Atom.java:89–101  ·  view source on GitHub ↗
(IFn f)

Source from the content-addressed store, hash-verified

87}
88
89public IPersistentVector swapVals(IFn f) {
90 for(; ;)
91 {
92 Object oldv = deref();
93 Object newv = f.invoke(oldv);
94 validate(newv);
95 if(state.compareAndSet(oldv, newv))
96 {
97 notifyWatches(oldv, newv);
98 return LazilyPersistentVector.createOwning(oldv, newv);
99 }
100 }
101}
102
103public IPersistentVector swapVals(IFn f, Object arg) {
104 for(; ;)

Callers

nothing calls this directly

Calls 8

derefMethod · 0.95
createOwningMethod · 0.95
listStarMethod · 0.95
validateMethod · 0.80
notifyWatchesMethod · 0.80
invokeMethod · 0.65
compareAndSetMethod · 0.65
applyToMethod · 0.65

Tested by

no test coverage detected