Skip to content

Commit

Permalink
fix:移除 LruCache 多余的同步块 (apache#601)
Browse files Browse the repository at this point in the history
fix:移除 LruCache 多余的同步块
  • Loading branch information
qinliujie authored Sep 6, 2017
1 parent d27b45e commit 0735bcb
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.common.utils.LRUCache;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;

/**
* LruCache
Expand All @@ -34,19 +32,15 @@ public class LruCache implements Cache {

public LruCache(URL url) {
final int max = url.getParameter("cache.size", 1000);
this.store = new LRUCache<Object,Object>(max);
this.store = new LRUCache<Object, Object>(max);
}

public void put(Object key, Object value) {
synchronized (store) {
store.put(key, value);
}
store.put(key, value);
}

public Object get(Object key) {
synchronized (store) {
return store.get(key);
}
return store.get(key);
}

}

0 comments on commit 0735bcb

Please sign in to comment.