ConcurrentHashMap中的java死锁
在运行时遵循代码,永远不会终止并陷入无休止的循环
我不确定它在哪里卡住了
有趣的是,当我把AaAa
改为AAAA
时,一切都正常
public class Test {
public static void main(String[] args) {
Map<String, Integer> map = new ConcurrentHashMap<>(16);
map.computeIfAbsent(
"AaAa",
key -> {
return map.computeIfAbsent(
"BBBB",
key2 -> 42);
}
);
}
}
有人能帮我理解这种行为吗
共 (0) 个答案