Package net.sf.ehcache.constructs.concurrent

Examples of net.sf.ehcache.constructs.concurrent.Mutex.acquire()


            if (element == null) {
                element = super.get(key);
            } else {
                Mutex lock = getLockForKey(key);
                try {
                    lock.acquire();
                    update(key);
                } finally {
                    lock.release();
                }
            }
View Full Code Here


     */
    public Element get(final Object key) throws RuntimeException, LockTimeoutException {
        Mutex lock = getLockForKey(key);
        try {
            if (timeoutMillis == 0) {
                lock.acquire();
            } else {
                boolean acquired = lock.attempt(timeoutMillis);
                if (!acquired) {
                    StringBuffer message = new StringBuffer("Lock timeout. Waited more than ")
                            .append(timeoutMillis)
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.