public class CountDownLatchInjectionImpl extends Injection implements CountDownLatchInjection
CountDownLatchInjection Degenerates to
PauseInjection.pause(), if initialized to zero count. In any case, this injection
provides more control than PauseInjection.| 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
|
protected boolean |
injectNow()
This function checks if it is the right time for the injection to happen.
|
getDesc, getMsPause, getSiteClass, isValidForBit, toStringprotected boolean injectNow()
Injectionpublic void initialize(int count)
CountDownLatchInjectioninitialize in interface CountDownLatchInjectioncount - the number of times CountDownLatchInjection.countDown() must be invoke before threads can pass through CountDownLatchInjection.await()public void await()
throws InterruptedException
CountDownLatchInjectioninterrupted.await in interface CountDownLatchInjectionInterruptedExceptionpublic void awaitUninterruptibly()
CountDownLatchInjectionawaitUninterruptibly in interface CountDownLatchInjectionpublic void countDown()
CountDownLatchInjectioncountDown in interface CountDownLatchInjectionpublic void close()
CountDownLatchInjectionclose in interface AutoCloseableclose in interface AutoCloseables.Closeableclose in interface CountDownLatchInjectionCopyright © 2022 The Apache Software Foundation. All rights reserved.