Class ConcurrencyUtils
java.lang.Object
org.apache.maven.surefire.util.internal.ConcurrencyUtils
Concurrency utilities.
- Since:
- 2.19
- Author:
- Tibor Digana (tibor17)
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
countDownToZero
(AtomicInteger counter) Decreasescounter
to zero, or does not change the counter if negative.
-
Method Details
-
countDownToZero
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.
-