提交 0735bcb4 编写于 作者: Q qinliujie 提交者: GitHub

fix:移除 LruCache 多余的同步块 (#601)

fix:移除 LruCache 多余的同步块
上级 d27b45ec
......@@ -19,9 +19,7 @@ import com.alibaba.dubbo.cache.Cache;
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
......@@ -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);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册