Package org.jboss.as.controller
Class UninterruptibleCountDownLatch
- java.lang.Object
-
- java.util.concurrent.CountDownLatch
-
- org.jboss.as.controller.UninterruptibleCountDownLatch
-
public final class UninterruptibleCountDownLatch extends CountDownLatch
Enhanced CountDownLatch providing uninterruptible variants of await() methods.- Author:
- Richard Opalka
-
-
Constructor Summary
Constructors Constructor Description UninterruptibleCountDownLatch(int count)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
awaitUninterruptibly()
Behaves the same way asCountDownLatch.await()
except it never throws InterruptedException.boolean
awaitUninterruptibly(long timeout, TimeUnit unit)
Behaves the same way asCountDownLatch.await(long,TimeUnit)
except it never throws InterruptedException.
-
-
-
Method Detail
-
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
public boolean awaitUninterruptibly(long timeout, TimeUnit unit)
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 thetimeout
argument- Returns:
true
if the count reached zero andfalse
if the waiting time elapsed before the count reached zero
-
-