changeset 739:d340d2f2ac7c

Fix PR854: Resizing an applet several times causes 100% CPU load
author Adam Domurad <adomurad@redhat.com>
date Tue, 21 May 2013 09:11:41 -0400
parents 838e90afbbb8
children b5b5f59833e2
files ChangeLog NEWS plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
diffstat 3 files changed, 9 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon May 20 15:42:42 2013 +0200
+++ b/ChangeLog	Tue May 21 09:11:41 2013 -0400
@@ -1,3 +1,9 @@
+2013-05-14  Adam Domurad  <adomurad@redhat.com>
+
+	Fix PR854: Resizing an applet several times causes 100% CPU load
+	* plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
+	(handleMessage): Replace buggy initialization wait.
+
 2013-05-20  Jiri Vanek  <jvanek@redhat.com>
 
 	Fixed possible deadlock for applet->js->applet call
--- a/NEWS	Mon May 20 15:42:42 2013 +0200
+++ b/NEWS	Tue May 21 09:11:41 2013 -0400
@@ -9,6 +9,8 @@
 CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY
 
 New in release 1.4.1 (2013-XX-YY):
+* Plugin
+  - PR854: Resizing an applet several times causes 100% CPU load
 
 New in release 1.4 (2013-05-02):
 * Added cs localization
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Mon May 20 15:42:42 2013 +0200
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Tue May 21 09:11:41 2013 -0400
@@ -681,18 +681,7 @@
         if (message.startsWith("width")) {
 
             // Wait for panel to come alive
-            long maxTimeToSleep = APPLET_TIMEOUT;
-            statusLock.lock();
-            try {
-                while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) &&
-                        maxTimeToSleep > 0) {
-                    maxTimeToSleep -= waitTillTimeout(statusLock, initComplete,
-                                                      maxTimeToSleep);
-                }
-            }
-            finally {
-                statusLock.unlock();
-            }
+            waitForAppletInit(panel);
 
             // 0 => width, 1=> width_value, 2 => height, 3=> height_value
             String[] dimMsg = message.split(" ");