Class ConcurrencyUtils
- java.lang.Object
-
- org.apache.maven.surefire.util.internal.ConcurrencyUtils
-
public final class ConcurrencyUtils extends java.lang.Object
Concurrency utilities.- Since:
- 2.19
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ConcurrencyUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
countDownToZero(java.util.concurrent.atomic.AtomicInteger counter)
Decreasescounter
to zero, or does not change the counter if negative.
-
-
-
Method Detail
-
countDownToZero
public static boolean countDownToZero(java.util.concurrent.atomic.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:
counter
- atomic counter- Returns:
true
if this Thread modified concurrent counter from any positive number down to zero.
-
-