aboutsummaryrefslogtreecommitdiffstats
path: root/plugin/icedteanp
diff options
context:
space:
mode:
authorAdam Domurad <[email protected]>2013-04-25 10:53:44 -0400
committerAdam Domurad <[email protected]>2013-04-25 10:53:44 -0400
commit61ca0a975341f40fbbb46379b10fbf77f0bf3d95 (patch)
tree59826404c41f9fd1060c0cf5bf284e945d09713f /plugin/icedteanp
parent03d8ad8d96243ec9499f0b974750b6ea64f7b41f (diff)
Fix a dead-lock bug that can cause Firefox to hang.
Diffstat (limited to 'plugin/icedteanp')
-rw-r--r--plugin/icedteanp/java/sun/applet/PluginAppletViewer.java30
1 files changed, 4 insertions, 26 deletions
diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
index 8423c5d..d07d0c2 100644
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
@@ -652,8 +652,7 @@ public class PluginAppletViewer extends XEmbeddedFrame
panelLock.lock();
try {
- while (panel.getApplet() == null &&
- panel.isAlive() &&
+ while (!panel.isInitialized() &&
maxTimeToSleep > 0) {
PluginDebug.debug("Waiting for applet panel ", panel, " to initialize...");
maxTimeToSleep -= waitTillTimeout(panelLock, panelLive, maxTimeToSleep);
@@ -731,37 +730,16 @@ public class PluginAppletViewer extends XEmbeddedFrame
// object should belong to?
Object o;
- // First, wait for panel to instantiate
- // Next, wait for panel to come alive
- long maxTimeToSleep = APPLET_TIMEOUT;
- panelLock.lock();
- try {
- while (panel == null || !panel.isAlive()) {
- maxTimeToSleep -= waitTillTimeout(panelLock, panelLive,
- maxTimeToSleep);
-
- /* we already waited till timeout, give up here directly,
- * instead of waiting 180s again in below waitForAppletInit()
- */
- if(maxTimeToSleep < 0) {
- streamhandler.write("instance " + identifier + " reference " + -1 + " fatalError: " + "Initialization timed out");
- return;
- }
- }
- }
- finally {
- panelLock.unlock();
- }
-
// Wait for the panel to initialize
// (happens in a separate thread)
waitForAppletInit(panel);
- PluginDebug.debug(panel, " -- ", panel.getApplet(), " -- ", panel.isAlive());
+ PluginDebug.debug(panel, " -- ", panel.getApplet(), " -- initialized: ", panel.isInitialized());
// Still null?
if (panel.getApplet() == null) {
- streamhandler.write("instance " + identifier + " reference " + -1 + " fatalError: " + "Initialization timed out");
+ streamhandler.write("instance " + identifier + " reference " + -1 + " fatalError: " + "Initialization failed");
+ streamhandler.write("context 0 reference " + reference + " Error");
return;
}