8190482: InnocuousThread creation should not require the caller to possess enableContextClassLoaderOverride
Reviewed-by: rriggs, mchung
This commit is contained in:
parent
018138a79c
commit
c5c047de47
@ -62,11 +62,17 @@ public final class InnocuousThread extends Thread {
|
||||
* set to the system class loader.
|
||||
*/
|
||||
public static Thread newThread(String name, Runnable target) {
|
||||
return AccessController.doPrivileged(
|
||||
new PrivilegedAction<Thread>() {
|
||||
@Override
|
||||
public Thread run() {
|
||||
return new InnocuousThread(INNOCUOUSTHREADGROUP,
|
||||
target,
|
||||
name,
|
||||
ClassLoader.getSystemClassLoader());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new InnocuousThread with an auto-generated thread name.
|
||||
@ -80,9 +86,15 @@ public final class InnocuousThread extends Thread {
|
||||
* Returns a new InnocuousThread with null context class loader.
|
||||
*/
|
||||
public static Thread newSystemThread(String name, Runnable target) {
|
||||
return AccessController.doPrivileged(
|
||||
new PrivilegedAction<Thread>() {
|
||||
@Override
|
||||
public Thread run() {
|
||||
return new InnocuousThread(INNOCUOUSTHREADGROUP,
|
||||
target, name, null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private InnocuousThread(ThreadGroup group, Runnable target, String name, ClassLoader tccl) {
|
||||
super(group, target, name, 0L, false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user