A countdown latch that will signal when the counter reaches zero. More...
Public Member Functions | |
void | decrement () |
Decrements the counter by one and signals if it reaches zero. More... | |
int | getCount () |
Gets the current count on the latch. More... | |
ManagedCountdownLatch () | |
Creates a new instance of the latch with an unknown count. More... | |
ManagedCountdownLatch (int initialCount) | |
Creates a new instance of the latch with a count. More... | |
void | reset () |
Resets the latch with an unknown count. More... | |
void | reset (int initialCount) |
Resets the latch with a count. More... | |
void | setCount (int count) |
Sets the counter for the latch. More... | |
String | toString () |
Generates a string description of this instance. More... | |
fm.liveswitch.Future< Object > | waitAsync () |
Returns a promise that resolves once the counter reaches zero. More... | |
void | waitSync () |
Blocks until the counter reaches zero. More... | |
A countdown latch that will signal when the counter reaches zero.
fm.liveswitch.ManagedCountdownLatch.ManagedCountdownLatch | ( | ) |
Creates a new instance of the latch with an unknown count.
This will cause the latch to count into the negatives until SetCount is called.
fm.liveswitch.ManagedCountdownLatch.ManagedCountdownLatch | ( | int | initialCount | ) |
Creates a new instance of the latch with a count.
initialCount | The initial counter value. |
void fm.liveswitch.ManagedCountdownLatch.decrement | ( | ) |
Decrements the counter by one and signals if it reaches zero.
int fm.liveswitch.ManagedCountdownLatch.getCount | ( | ) |
Gets the current count on the latch.
void fm.liveswitch.ManagedCountdownLatch.reset | ( | ) |
Resets the latch with an unknown count.
This will cause the latch to count into the negatives until SetCount is called.
void fm.liveswitch.ManagedCountdownLatch.reset | ( | int | initialCount | ) |
Resets the latch with a count.
initialCount | The initial counter value. |
void fm.liveswitch.ManagedCountdownLatch.setCount | ( | int | count | ) |
Sets the counter for the latch.
This brings the count back up into positive numbers.
String fm.liveswitch.ManagedCountdownLatch.toString | ( | ) |
Generates a string description of this instance.
fm.liveswitch.Future<Object> fm.liveswitch.ManagedCountdownLatch.waitAsync | ( | ) |
Returns a promise that resolves once the counter reaches zero.
void fm.liveswitch.ManagedCountdownLatch.waitSync | ( | ) |
Blocks until the counter reaches zero.