MCPcopy Index your code
hub / github.com/grpc/grpc-java / AtomicLongCounter

Class AtomicLongCounter

core/src/main/java/io/grpc/internal/AtomicLongCounter.java:24–42  ·  view source on GitHub ↗

An implementation of LongCounter that is just an AtomicLong.

Source from the content-addressed store, hash-verified

22 * An implementation of {@link LongCounter} that is just an {@link AtomicLong}.
23 */
24final class AtomicLongCounter implements LongCounter {
25 private final AtomicLong counter = new AtomicLong();
26
27 /**
28 * Creates an {@link AtomicLongCounter}.
29 */
30 AtomicLongCounter() {
31 }
32
33 @Override
34 public void add(long delta) {
35 counter.getAndAdd(delta);
36 }
37
38 @Override
39 public long value() {
40 return counter.get();
41 }
42}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected