mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-26 18:20:28 +00:00
7189103: Executors needs to maintain state
Reviewed-by: dholmes, hawtin
This commit is contained in:
parent
e5fbf01489
commit
9f27d2af4c
@ -530,18 +530,17 @@ public class Executors {
|
||||
return AccessController.doPrivileged(
|
||||
new PrivilegedExceptionAction<T>() {
|
||||
public T run() throws Exception {
|
||||
ClassLoader savedcl = null;
|
||||
Thread t = Thread.currentThread();
|
||||
try {
|
||||
ClassLoader cl = t.getContextClassLoader();
|
||||
if (ccl != cl) {
|
||||
t.setContextClassLoader(ccl);
|
||||
savedcl = cl;
|
||||
}
|
||||
ClassLoader cl = t.getContextClassLoader();
|
||||
if (ccl == cl) {
|
||||
return task.call();
|
||||
} finally {
|
||||
if (savedcl != null)
|
||||
t.setContextClassLoader(savedcl);
|
||||
} else {
|
||||
t.setContextClassLoader(ccl);
|
||||
try {
|
||||
return task.call();
|
||||
} finally {
|
||||
t.setContextClassLoader(cl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, acc);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user