Package jersey.repackaged.jsr166e

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


    public ReadMostlyVector<E> clone() {
        Object[] a = null;
        int n;
        final StampedLock lock = this.lock;
        long stamp = lock.readLock();
        try {
            Object[] items = array;
            if (items == null)
                n = 0;
            else {
View Full Code Here


    }

    private void writeObject(java.io.ObjectOutputStream s)
        throws java.io.IOException {
        final StampedLock lock = this.lock;
        long stamp = lock.readLock();
        try {
            s.defaultWriteObject();
        } finally {
            lock.unlockRead(stamp);
        }
View Full Code Here

        int fence;
        int lastRet;

        Itr(ReadMostlyVector<E> list, int index) {
            final StampedLock lock = list.lock;
            long stamp = lock.readLock();
            try {
                this.list = list;
                this.lock = lock;
                this.items = list.array;
                this.fence = list.count;
View Full Code Here

            return indexOf(o) >= 0;
        }

        public boolean containsAll(Collection<?> c) {
            final StampedLock lock = list.lock;
            long stamp = lock.readLock();
            try {
                return list.internalContainsAll(c, offset, offset + size);
            } finally {
                lock.unlockRead(stamp);
            }
View Full Code Here

            if (o == this)
                return true;
            if (!(o instanceof List))
                return false;
            final StampedLock lock = list.lock;
            long stamp = lock.readLock();
            try {
                return list.internalEquals((List<?>)(o), offset, offset + size);
            } finally {
                lock.unlockRead(stamp);
            }
View Full Code Here

            return list.get(index + offset);
        }

        public int hashCode() {
            final StampedLock lock = list.lock;
            long stamp = lock.readLock();
            try {
                return list.internalHashCode(offset, offset + size);
            } finally {
                lock.unlockRead(stamp);
            }
View Full Code Here

            }
        }

        public int indexOf(Object o) {
            final StampedLock lock = list.lock;
            long stamp = lock.readLock();
            try {
                int idx = findFirstIndex(list.array, o, offset, offset + size);
                return idx < 0 ? -1 : idx - offset;
            } finally {
                lock.unlockRead(stamp);
View Full Code Here

            return new SubItr<E>(this, offset);
        }

        public int lastIndexOf(Object o) {
            final StampedLock lock = list.lock;
            long stamp = lock.readLock();
            try {
                int idx = findLastIndex(list.array, o, offset + size - 1, offset);
                return idx < 0 ? -1 : idx - offset;
            } finally {
                lock.unlockRead(stamp);
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.