public final class ConcurrencyUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
runIfZeroCountDown(Runnable runner,
AtomicInteger counter)
Decreases
counter to zero, or does not change the counter if negative. |
public static void runIfZeroCountDown(Runnable runner, 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.runner
- run if this Thread has concurrently decremented the counter down to zerocounter
- atomic counterCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.