public class CountDownAndUpLatch extends Object
| Constructor and Description |
|---|
CountDownAndUpLatch() |
| Modifier and Type | Method and Description |
|---|---|
void |
await()
Waits for the counter to become non-positive.
|
void |
countDown()
Decreases the counter by 1 in a thread-safe manner.
|
void |
countUp()
Increases the counter by 1 in a thread-safe manner.
|
int |
getCurrentCount() |
public void countUp()
public void countDown()
Notifies all waiting threads if the counter becomes zero.
public void await()
throws InterruptedException
InterruptedExceptionpublic int getCurrentCount()
Copyright © 2015–2020. All rights reserved.