提交 c908a707 编写于 作者: N naoto

7022407: Spinning CPU in LocaleObjectCache.get()

Reviewed-by: okutsu
上级 69603e4f
......@@ -66,14 +66,14 @@ public abstract class LocaleObjectCache<K, V> {
CacheEntry<K, V> newEntry = new CacheEntry<>(key, newVal, queue);
while (value == null) {
cleanStaleEntries();
entry = map.putIfAbsent(key, newEntry);
if (entry == null) {
entry = map.putIfAbsent(key, newEntry);
if (entry == null) {
value = newVal;
} else {
value = entry.get();
if (value == null) {
map.put(key, newEntry);
value = newVal;
break;
} else {
value = entry.get();
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册