Code example for AtomicReference

Methods: get

0
                                           AtomicBoolean exceptionBoolean,
                                           AtomicReference<StackMobException> exceptionReference)
    throws StackMobException, InterruptedException { 
        boolean finished = wasLatchFinished(latch);
        if(!finished && exceptionBoolean.get()) {
            throw exceptionReference.get();
        } 
        else if(!finished) {
            fail("latch didn't count down in " + latchWaitTime.getKey() + " " + latchWaitTime.getValue().toString().toLowerCase());
        } 
    } 
 
    public static CountDownLatch latch(int count) {
        return new CountDownLatch(count);
    } 
 
    public static CountDownLatch latchOne() {
        return latch(1); 
    } 
}