Java Code Examples for java.util.concurrent.atomic.LongAdder#decrement()
The following examples show how to use
java.util.concurrent.atomic.LongAdder#decrement() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VertxPoolMetrics.java From vertx-micrometer-metrics with Apache License 2.0 | 5 votes |
@Override public void end(Timers.EventTiming begin, boolean succeeded) { LongAdder l = inUse.get(poolType, poolName); l.decrement(); checkRatio(l.longValue()); begin.end(poolType, poolName); completed.get(poolType, poolName).increment(); }
Example 2
Source File: LongAdderTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * decrement decrements and sum returns current value */ public void testDecrementAndsum() { LongAdder ai = new LongAdder(); ai.decrement(); assertEquals(-1, ai.sum()); ai.decrement(); assertEquals(-2, ai.sum()); }
Example 3
Source File: LongAdderTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * decrement decrements and sum returns current value */ public void testDecrementAndsum() { LongAdder ai = new LongAdder(); ai.decrement(); assertEquals(-1, ai.sum()); ai.decrement(); assertEquals(-2, ai.sum()); }