Package org.jboss.as.controller
Class UninterruptibleCountDownLatch
java.lang.Object
java.util.concurrent.CountDownLatch
org.jboss.as.controller.UninterruptibleCountDownLatch
Enhanced CountDownLatch providing uninterruptible variants of await() methods.
- Author:
- Richard Opalka
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidBehaves the same way asCountDownLatch.await()except it never throws InterruptedException.booleanawaitUninterruptibly(long timeout, TimeUnit unit) Behaves the same way asCountDownLatch.await(long,TimeUnit)except it never throws InterruptedException.
-
Constructor Details
-
UninterruptibleCountDownLatch
public UninterruptibleCountDownLatch(int count)
-
-
Method Details
-
awaitUninterruptibly
public void awaitUninterruptibly()Behaves the same way asCountDownLatch.await()except it never throws InterruptedException. Thread interrupt status will be preserved if thread have been interrupted inside this method. -
awaitUninterruptibly
Behaves the same way asCountDownLatch.await(long,TimeUnit)except it never throws InterruptedException. Thread interrupt status will be preserved if thread have been interrupted inside this method.- Parameters:
timeout- the maximum time to waitunit- the time unit of thetimeoutargument- Returns:
trueif the count reached zero andfalseif the waiting time elapsed before the count reached zero
-