jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java
changeset 20805 ae41216325dd
parent 10324 e28265130e4f
child 23010 6dadb192ad81
--- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java	Wed May 08 09:21:59 2013 +0800
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java	Thu Jun 13 10:21:06 2013 +0800
@@ -25,11 +25,12 @@
 
 package com.sun.jndi.ldap;
 
-import java.net.URL;
 import java.net.URLClassLoader;
 import java.net.MalformedURLException;
+import java.security.AccessControlContext;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import sun.misc.SharedSecrets;
 
 final class VersionHelper12 extends VersionHelper {
 
@@ -82,12 +83,16 @@
     }
 
     Thread createThread(final Runnable r) {
+        final AccessControlContext acc = AccessController.getContext();
+        // 4290486: doPrivileged is needed to create a thread in
+        // an environment that restricts "modifyThreadGroup".
         return AccessController.doPrivileged(
-            new PrivilegedAction<Thread>() {
-                public Thread run() {
-                    return new Thread(r);
+                new PrivilegedAction<Thread>() {
+                    public Thread run() {
+                        return SharedSecrets.getJavaLangAccess()
+                                .newThreadWithAcc(r, acc);
+                    }
                 }
-            }
         );
     }
 }