RFR: 8279488: ProcessBuilder inherits contextClassLoader when spawning a process reaper thread

Alan Bateman alanb at openjdk.java.net
Fri Mar 18 11:54:33 UTC 2022


On Tue, 18 Jan 2022 15:57:58 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> The thread factory used to create the process reaper threads unnecessarily inherits the callers thread context classloader.
> The result is retention of the class loader.
> 
> The thread factory used for the pool of process reaper threads is modified to use an InnocuousThread with a given stacksize.
> The test verifies that the process reaper threads have a null context classloader.

src/java.base/share/classes/jdk/internal/misc/InnocuousThread.java line 138:

> 136:         Thread t = new InnocuousThread(INNOCUOUSTHREADGROUP,
> 137:                 target, name, stackSize, loader);
> 138:         if (priority >= 0) {

Adding an addition newSystemThread method should be okay but can you fix the formatting/line lengths so it's a bit more inconsistent with the existing code.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7131


More information about the core-libs-dev mailing list