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

Deepak Bhole dbhole at redhat.com
Mon Jul 16 13:22:12 PDT 2012


* Thomas Meyer <thomas at m3y3r.de> [2012-07-16 16:17]:
> Resend.
> 

Sorry, missed this. Looks fine to me, OK for head.

Thanks!
Deepak

> # 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();
> 

-- 
Cheers,
Deepak



More information about the distro-pkg-dev mailing list