6898310: (cs) Charset cache lookups should be synchronized
authorsherman
Fri, 02 Sep 2011 10:20:08 -0700
changeset 10424 df8a25e78db3
parent 10423 2c852092a4e5
child 10425 7903cf45f96f
6898310: (cs) Charset cache lookups should be synchronized Summary: synchronize the lookup in iterator Reviewed-by: alanb
jdk/src/share/classes/sun/nio/cs/AbstractCharsetProvider.java
--- a/jdk/src/share/classes/sun/nio/cs/AbstractCharsetProvider.java	Thu Sep 01 23:00:09 2011 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/AbstractCharsetProvider.java	Fri Sep 02 10:20:08 2011 -0700
@@ -179,7 +179,9 @@
 
                 public Charset next() {
                     String csn = i.next();
-                    return lookup(csn);
+                    synchronized (AbstractCharsetProvider.this) {
+                        return lookup(csn);
+                    }
                 }
 
                 public void remove() {