From 098c59976e03f2eee43b907bb223ed552ef080a8 Mon Sep 17 00:00:00 2001 From: Thomas Meyer Date: Thu, 19 Jul 2012 18:44:51 +0200 Subject: Fix possible endless loop while waiting for the applet object instance to get create get created --- plugin/icedteanp/java/sun/applet/PluginAppletViewer.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'plugin/icedteanp/java/sun/applet/PluginAppletViewer.java') diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java index 6017fa9..b901074 100644 --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java @@ -745,9 +745,18 @@ public class PluginAppletViewer extends XEmbeddedFrame long maxTimeToSleep = APPLET_TIMEOUT; panelLock.lock(); try { - while (panel == null || !panel.isAlive()) + 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(); -- cgit v1.2.3