mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-12 06:29:37 +00:00
7022407: Spinning CPU in LocaleObjectCache.get()
Reviewed-by: okutsu
This commit is contained in:
parent
082623e70e
commit
e3c0616ac7
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user