mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-04 21:01:16 +00:00
JMH 多线程缓存淘汰压力测试,存在并发问题
checkMaximumSize sorted
This commit is contained in:
1 parent
b8c0ea04a6
commit
c401f882e7
1 file changed
+1
-1
@@ -155,7 +155,7 @@ public class LazyCache<K, V> {
|
||||
removeListener.accept(removeList, removalCause);
|
||||
}
|
||||
|
||||
private void checkMaximumSize() {
|
||||
private synchronized void checkMaximumSize() {
|
||||
if (cacheMap.size() > backPressureSize) {
|
||||
var removeList = cacheMap.values()
|
||||
.stream()
|
||||
|
||||
Reference in new issue
Block a user