public interface CountDownLatchInjection extends AutoCloseables.Closeable
ExecConstants.DRILLBIT_CONTROL_INJECTIONS session option.
This injection is useful in the case where a thread spawns multiple threads. The parent thread initializes the latch
with the expected number of countdown and awaits. The child threads count down on the same latch (same site class
and same descriptor), and once there are enough, the parent thread continues.| Modifier and Type | Method and Description |
|---|---|
void |
await()
Causes the current thread to wait until the latch has counted down to zero, unless the thread is
interrupted. |
void |
awaitUninterruptibly()
Await without interruption.
|
void |
close()
Close the latch.
|
void |
countDown()
Decrements the count of the latch, releasing all waiting threads if the count reaches zero.
|
void |
initialize(int count)
Initializes the underlying latch
|
void initialize(int count)
count - the number of times countDown() must be invoke before threads can pass through await()void await()
throws InterruptedException
interrupted.InterruptedExceptionvoid awaitUninterruptibly()
void countDown()
void close()
close in interface AutoCloseableclose in interface AutoCloseables.CloseableCopyright © 2022 The Apache Software Foundation. All rights reserved.