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

Method swap

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

Source from the content-addressed store, hash-verified

31}
32
33public Object swap(IFn f) {
34 for(; ;)
35 {
36 Object v = deref();
37 Object newv = f.invoke(v);
38 validate(newv);
39 if(state.compareAndSet(v, newv))
40 {
41 notifyWatches(v, newv);
42 return newv;
43 }
44 }
45}
46
47public Object swap(IFn f, Object arg) {
48 for(; ;)

Callers

nothing calls this directly

Calls 7

derefMethod · 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