MCPcopy Create free account
hub / github.com/ReadyTalk/avian / getAndAdd

Method getAndAdd

classpath/java/util/concurrent/atomic/AtomicLong.java:71–79  ·  view source on GitHub ↗
(long delta)

Source from the content-addressed store, hash-verified

69 }
70
71 public long getAndAdd(long delta) {
72 while (true) {
73 long current = value;
74 long next = current + delta;
75 if (compareAndSet(current, next)) {
76 return current;
77 }
78 }
79 }
80
81 public long getAndIncrement() {
82 return getAndAdd(1);

Callers 2

getAndIncrementMethod · 0.95
getAndDecrementMethod · 0.95

Calls 1

compareAndSetMethod · 0.95

Tested by

no test coverage detected