Package jersey.repackaged.jsr166e

Examples of jersey.repackaged.jsr166e.StampedLock.validate()


        long stamp = lock.tryOptimisticRead();
        Object[] items;
        if (index >= 0 && (items = array) != null &&
            index < count && index < items.length) {
            @SuppressWarnings("unchecked") E e = (E)items[index];
            if (lock.validate(stamp))
                return e;
        }
        return lockedGet(index);
    }
View Full Code Here


        final StampedLock lock = this.lock;
        long stamp = lock.tryOptimisticRead();
        Object[] items;
        if ((items = array) != null && count > 0 && items.length > 0) {
            @SuppressWarnings("unchecked") E e = (E)items[0];
            if (lock.validate(stamp))
                return e;
        }
        return lockedFirstElement();
    }
View Full Code Here

        Object[] items;
        int i;
        if ((items = array) != null && (i = count - 1) >= 0 &&
            i < items.length) {
            @SuppressWarnings("unchecked") E e = (E)items[i];
            if (lock.validate(stamp))
                return e;
        }
        return lockedLastElement();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.