]> granicus.if.org Git - icu/commitdiff
ICU-13335 make CacheValue.SoftValue.ref volatile
authorMarkus Scherer <markus.icu@gmail.com>
Wed, 27 Sep 2017 22:59:32 +0000 (22:59 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Wed, 27 Sep 2017 22:59:32 +0000 (22:59 +0000)
X-SVN-Rev: 40489

icu4j/main/classes/core/src/com/ibm/icu/impl/CacheValue.java

index 340b4de48be1470107fcd2b9dec2b12b7bf620cb..cf655fcadd6b9a92e0fa2d63bb9ac8191777d0f2 100644 (file)
@@ -129,7 +129,7 @@ public abstract class CacheValue<V> {
     }
 
     private static final class SoftValue<V> extends CacheValue<V> {
-        private Reference<V> ref;
+        private volatile Reference<V> ref;  // volatile for unsynchronized get()
 
         SoftValue(V value) { ref = new SoftReference<V>(value); }
         @Override