8078216: JRE installation is stuck at Progress dialog
authorserb
Wed, 29 Apr 2015 19:43:55 +0300
changeset 30488 3a8007752b94
parent 30487 e6658a917239
child 30490 2c6afe93e4cd
8078216: JRE installation is stuck at Progress dialog Reviewed-by: prr, ddehaven
jdk/src/java.desktop/share/classes/sun/awt/AWTAutoShutdown.java
--- a/jdk/src/java.desktop/share/classes/sun/awt/AWTAutoShutdown.java	Wed Apr 29 20:06:35 2015 +0400
+++ b/jdk/src/java.desktop/share/classes/sun/awt/AWTAutoShutdown.java	Wed Apr 29 19:43:55 2015 +0300
@@ -26,7 +26,6 @@
 package sun.awt;
 
 import java.awt.AWTEvent;
-
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.HashSet;
@@ -34,9 +33,9 @@
 import java.util.Map;
 import java.util.Set;
 
+import sun.awt.util.ThreadGroupUtils;
 import sun.misc.InnocuousThread;
 import sun.util.logging.PlatformLogger;
-import sun.awt.util.ThreadGroupUtils;
 
 /**
  * This class is to let AWT shutdown automatically when a user is done
@@ -218,10 +217,7 @@
         synchronized (activationLock) {
             synchronized (mainLock) {
                 if (!isReadyToShutdown() && blockerThread == null) {
-                    AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
-                        activateBlockerThread();
-                        return null;
-                    });
+                    activateBlockerThread();
                 } else {
                     mainLock.notifyAll();
                     timeoutPassed = false;
@@ -337,21 +333,22 @@
     /**
      * Creates and starts a new blocker thread. Doesn't return until
      * the new blocker thread starts.
-     *
-     * Must be called with {@link sun.security.util.SecurityConstants#MODIFY_THREADGROUP_PERMISSION}
      */
     private void activateBlockerThread() {
-        Thread thread;
-        String name =  "AWT-Shutdown";
-        if (System.getSecurityManager() == null) {
-            thread = new Thread(ThreadGroupUtils.getRootThreadGroup(), this, name);
-        } else {
-            thread = new InnocuousThread(this, name);
-        }
-        thread.setContextClassLoader(null);
-        thread.setDaemon(false);
-        blockerThread = thread;
-        thread.start();
+        AccessController.doPrivileged((PrivilegedAction<Thread>) () -> {
+            Thread thread;
+            String name = "AWT-Shutdown";
+            if (System.getSecurityManager() == null) {
+                thread = new Thread(ThreadGroupUtils.getRootThreadGroup(), this,
+                                    name);
+            } else {
+                thread = new InnocuousThread(this, name);
+            }
+            thread.setContextClassLoader(null);
+            thread.setDaemon(false);
+            blockerThread = thread;
+            return thread;
+        }).start();
         try {
             /* Wait for the blocker thread to start. */
             mainLock.wait();