public final class ConcurrencyUtils
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
private |
ConcurrencyUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
countDownToZero(java.util.concurrent.atomic.AtomicInteger counter)
Decreases
counter to zero, or does not change the counter if negative. |
public static boolean countDownToZero(java.util.concurrent.atomic.AtomicInteger counter)
counter to zero, or does not change the counter if negative.
This method pretends been atomic. Only one thread can succeed setting the counter to zero.counter - atomic countertrue if this Thread modified concurrent counter from any positive number down to zero.