Package net.sf.ehcache.concurrent

Examples of net.sf.ehcache.concurrent.Mutex.release()


                }
            }
            final Element element = cache.get(key);
            if (element != null) {
                //ok let the other threads in
                lock.release();
                return element;
            } else {
                //don't release the read lock until we put
                return null;
            }
View Full Code Here


            } else {
                cache.remove(key);
            }
        } finally {
            //Release the readlock here. This will have been acquired in the get, where the element was null
            lock.release();
        }
    }

    /**
     * Put an element in the cache.
View Full Code Here

                Mutex lock = stripedMutex.getMutexForKey(key);
                try {
                    lock.acquire();
                    update(key);
                } finally {
                    lock.release();
                }
            }
            return element;
        } catch (final Throwable throwable) {
            // Could not fetch - Ditch the entry from the cache and rethrow
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.