diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | plugin/icedteanp/java/sun/applet/PluginAppletViewer.java | 11 |
2 files changed, 13 insertions, 5 deletions
@@ -1,3 +1,10 @@ +2011-03-08 Denis Lila <[email protected]> + + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java + (getRequestIdentifier): Fix race condition by synchronizing + on mutex. + (requestIdentityCounter): Now a long. + 2011-03-07 Omair Majid <[email protected]> * acinclude.m4 (IT_FIND_RHINO_JAR): Set RHINO_AVAILABLE to true or false diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java index bd3637f..d863f16 100644 --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java @@ -356,7 +356,8 @@ public class PluginAppletViewer extends XEmbeddedFrame public static final int APPLET_TIMEOUT = 180000; - private static Long requestIdentityCounter = 0L; + private static final Object requestMutex = new Object(); + private static long requestIdentityCounter = 0L; private Image bufFrameImg; private Graphics bufFrameImgGraphics; @@ -990,11 +991,11 @@ public class PluginAppletViewer extends XEmbeddedFrame * * @return A unique Long identifier for the request */ - private static Long getRequestIdentifier() { - synchronized (requestIdentityCounter) { - - if (requestIdentityCounter == Long.MAX_VALUE) + private static long getRequestIdentifier() { + synchronized(requestMutex) { + if (requestIdentityCounter == Long.MAX_VALUE) { requestIdentityCounter = 0L; + } return requestIdentityCounter++; } |