Package xbird.util.concurrent.lock

Examples of xbird.util.concurrent.lock.ILock


            }
            return readBlock;
        }

        private int[] getBlock(final int page) {
            final ILock lock = _lock;
            lock.lock();
            try {
                return _pageReadCache.get(page);
            } finally {
                lock.unlock();
            }
        }
View Full Code Here


                lock.unlock();
            }
        }

        private void putBlock(final int page, final int[] b) {
            final ILock lock = _lock;
            lock.lock();
            try {
                _pageReadCache.putIfAbsent(page, b);
            } finally {
                lock.unlock();
            }
        }
View Full Code Here

    public Sequence<? extends Item> eval(Sequence<? extends Item> contextSeq, DynamicContext dynEnv)
            throws XQueryException {
        if(_result != null) {
            return _result;
        }
        final ILock lock = _lock;
        if(_exported && !lock.isLocked()) {
            throw new IllegalStateException("ThreadVariable#" + getName()
                    + " should not called by this thread: " + Thread.currentThread().getName());
        }
        lock.lock();
        try {
            if(_catchedException != null) {
                throw _catchedException;
            }
            final Sequence result = _result;
            if(result == null) {
                throw new XQueryException("Result of ThreadedVariable#" + getName()
                        + " was illegally null");
            }
            return result;
        } finally {
            lock.unlock();
            this._dynEnv = null;
            //this._result = null;
        }
    }
View Full Code Here

            }
            return readBlock;
        }

        private long[] getBlock(final int page) {
            final ILock lock = _lock;
            lock.lock();
            try {
                return _pageReadCache.get(page);
            } finally {
                lock.unlock();
            }
        }
View Full Code Here

                lock.unlock();
            }
        }

        private void putBlock(final int page, final long[] b) {
            final ILock lock = _lock;
            lock.lock();
            try {
                _pageReadCache.putIfAbsent(page, b);
            } finally {
                lock.unlock();
            }
        }
View Full Code Here

            }
            return readBlock;
        }

        private long[] getBlock(final int page) {
            final ILock lock = _lock;
            lock.lock();
            try {
                return _pageReadCache.get(page);
            } finally {
                lock.unlock();
            }
        }
View Full Code Here

                lock.unlock();
            }
        }

        private void putBlock(final int page, final long[] b) {
            final ILock lock = _lock;
            lock.lock();
            try {
                _pageReadCache.putIfAbsent(page, b);
            } finally {
                lock.unlock();
            }
        }
View Full Code Here

            }
            return readBlock;
        }

        private int[] getBlock(final int page) {
            final ILock lock = _lock;
            lock.lock();
            try {
                return _pageReadCache.get(page);
            } finally {
                lock.unlock();
            }
        }
View Full Code Here

                lock.unlock();
            }
        }

        private void putBlock(final int page, final int[] b) {
            final ILock lock = _lock;
            lock.lock();
            try {
                _pageReadCache.putIfAbsent(page, b);
            } finally {
                lock.unlock();
            }
        }
View Full Code Here

TOP

Related Classes of xbird.util.concurrent.lock.ILock

Copyright © 2018 www.massapicom. 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.