Skip to content

Commit 0735bcb

Browse files
authored
fix:移除 LruCache 多余的同步块 (apache#601)
fix:移除 LruCache 多余的同步块
1 parent d27b45e commit 0735bcb

File tree

1 file changed

+3
-9
lines changed
  • dubbo-filter/dubbo-filter-cache/src/main/java/com/alibaba/dubbo/cache/support/lru

1 file changed

+3
-9
lines changed

dubbo-filter/dubbo-filter-cache/src/main/java/com/alibaba/dubbo/cache/support/lru/LruCache.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
import com.alibaba.dubbo.common.URL;
2020
import com.alibaba.dubbo.common.utils.LRUCache;
2121

22-
import java.util.LinkedHashMap;
2322
import java.util.Map;
24-
import java.util.Map.Entry;
2523

2624
/**
2725
* LruCache
@@ -34,19 +32,15 @@ public class LruCache implements Cache {
3432

3533
public LruCache(URL url) {
3634
final int max = url.getParameter("cache.size", 1000);
37-
this.store = new LRUCache<Object,Object>(max);
35+
this.store = new LRUCache<Object, Object>(max);
3836
}
3937

4038
public void put(Object key, Object value) {
41-
synchronized (store) {
42-
store.put(key, value);
43-
}
39+
store.put(key, value);
4440
}
4541

4642
public Object get(Object key) {
47-
synchronized (store) {
48-
return store.get(key);
49-
}
43+
return store.get(key);
5044
}
5145

5246
}

0 commit comments

Comments
 (0)