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, toString
protected boolean injectNow()
Injection
public void initialize(int count)
CountDownLatchInjection
initialize
in interface CountDownLatchInjection
count
- the number of times CountDownLatchInjection.countDown()
must be invoke before threads can pass through CountDownLatchInjection.await()
public void await() throws InterruptedException
CountDownLatchInjection
interrupted
.await
in interface CountDownLatchInjection
InterruptedException
public void awaitUninterruptibly()
CountDownLatchInjection
awaitUninterruptibly
in interface CountDownLatchInjection
public void countDown()
CountDownLatchInjection
countDown
in interface CountDownLatchInjection
public void close()
CountDownLatchInjection
close
in interface AutoCloseable
close
in interface AutoCloseables.Closeable
close
in interface CountDownLatchInjection
Copyright © 1970 The Apache Software Foundation. All rights reserved.