public class CountLatch extends Object
CountDownLatch but with the ability
to also count up. This is useful to wait until a variable number of tasks
have completed. awaitZero() will block until the count reaches zero.| Constructor and Description |
|---|
CountLatch(int count) |
| Modifier and Type | Method and Description |
|---|---|
void |
awaitZero() |
boolean |
awaitZero(long timeout,
TimeUnit unit) |
void |
decrement() |
void |
increment() |
boolean |
isAtZero()
Gets whether this counting latch has arrived at zero
|
void |
resetAndInterrupt()
Resets the counter to zero.
|
String |
toString() |
public void awaitZero()
throws InterruptedException
InterruptedExceptionpublic boolean awaitZero(long timeout,
TimeUnit unit)
throws InterruptedException
InterruptedExceptionpublic void increment()
public void decrement()
public void resetAndInterrupt()
public boolean isAtZero()
Copyright © 2021 Secure Software Engineering Group - University of Paderborn. All rights reserved.