[rfc][icedtea-web] PAV - Add missing timeout check

Thomas Meyer thomas at m3y3r.de
Mon Jul 16 13:15:58 PDT 2012


Resend.

# HG changeset patch
# Parent 01544fb823842910b062b5b05b6872812ceecb98

diff -r 01544fb82384 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Wed Jul 11 16:18:58 2012 +0200
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Mon Jul 16 22:08:38 2012 +0200
@@ -745,9 +745,19 @@
             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) {
+                        panelLock.unlock();
+                        streamhandler.write("instance " + identifier + " reference " + -1 + " fatalError: " + "Initialization timed out");
+                        return;
+                    }
+                }
             }
             finally {
                 panelLock.unlock();




More information about the distro-pkg-dev mailing list