]> granicus.if.org Git - icu/commitdiff
ICU-11697 SimpleCache thread safety - changed cacheRef to volatile.
authorYoshito Umaoka <y.umaoka@gmail.com>
Thu, 28 May 2015 06:47:50 +0000 (06:47 +0000)
committerYoshito Umaoka <y.umaoka@gmail.com>
Thu, 28 May 2015 06:47:50 +0000 (06:47 +0000)
X-SVN-Rev: 37468

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

index 8511393936b1942192fe66e5c9fdc26efb19ea3f..8402360ced0acbb2766d17320bd7f4cdc66f2a07 100644 (file)
@@ -1,6 +1,6 @@
 /*
  ****************************************************************************
- * Copyright (c) 2007-2009 International Business Machines Corporation and  *
+ * Copyright (c) 2007-2015 International Business Machines Corporation and  *
  * others.  All rights reserved.                                            *
  ****************************************************************************
  */
@@ -17,7 +17,7 @@ import java.util.Map;
 public class SimpleCache<K, V> implements ICUCache<K, V> {
     private static final int DEFAULT_CAPACITY = 16;
 
-    private Reference<Map<K, V>> cacheRef = null;
+    private volatile Reference<Map<K, V>> cacheRef = null;
     private int type = ICUCache.SOFT;
     private int capacity = DEFAULT_CAPACITY;