提交 51ea0f8c 编写于 作者: C chegar

7189103: Executors needs to maintain state

Reviewed-by: dholmes, hawtin
上级 1c18c8e5
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册