Class ConcurrencyUtils
- java.lang.Object
-
- org.apache.maven.surefire.api.util.internal.ConcurrencyUtils
-
public final class ConcurrencyUtils extends Object
Concurrency utilities.- Since:
- 2.19
- Author:
- Tibor Digana (tibor17)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
runIfZeroCountDown(Runnable runner, AtomicInteger counter)
Decreasescounter
to zero, or does not change the counter if negative.
-
-
-
Method Detail
-
runIfZeroCountDown
public static void runIfZeroCountDown(Runnable runner, AtomicInteger counter)
Decreasescounter
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.- Parameters:
runner
- run if this Thread has concurrently decremented the counter down to zerocounter
- atomic counter
-
-