ARTEMIS-4499 fix ThreadCreateAction so it works properly with SecurityManager
Issue: https://issues.apache.org/jira/browse/ARTEMIS-4499 Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
This commit is contained in:
parent
4838cb7725
commit
4a13449056
|
@ -123,7 +123,14 @@ public final class ActiveMQThreadFactory implements ThreadFactory {
|
|||
};
|
||||
t.setDaemon(daemon);
|
||||
t.setPriority(threadPriority);
|
||||
t.setContextClassLoader(tccl);
|
||||
if (acc != null) {
|
||||
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
|
||||
t.setContextClassLoader(tccl);
|
||||
return null; // nothing to return
|
||||
});
|
||||
} else {
|
||||
t.setContextClassLoader(tccl);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue