LRUCache impl synchronizes on the map, not the cache

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@681440 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2008-07-31 18:59:52 +00:00
parent a00e9176f0
commit a7cda85584
1 changed files with 5 additions and 5 deletions

View File

@ -113,12 +113,12 @@ public class LRUCache implements SolrCache {
}
}
public synchronized Object put(Object key, Object value) {
if (state == State.LIVE) {
stats.inserts.incrementAndGet();
}
public Object put(Object key, Object value) {
synchronized (map) {
if (state == State.LIVE) {
stats.inserts.incrementAndGet();
}
// increment local inserts regardless of state???
// it does make it more consistent with the current size...
inserts++;