On Sun, 5 Jul 2026 09:42:39 GMT, Alan Bateman <[email protected]> wrote:
>> Per Minborg has updated the pull request incrementally with two additional
>> commits since the last revision:
>>
>> - Add local pools
>> - Add 4 nested levels
>
> src/java.base/share/classes/java/lang/Thread.java line 1626:
>
>> 1624: if (isVirtual() || hasConfinedMemoryPools()) {
>> 1625: ConfinedSegmentPool.releaseOnThreadExit(this);
>> 1626: }
>
> Thread.exit is only invoked by the VM for platform threads so isVirtual will
> always be false here.
>
> For VirtualThreads, you've got the hook in afterDone to handle it.
Need to think about ordering here, specifically whether
ConfinedSegmentPool.releaseOnThreadExit might execute code that uses a
TerminatingThreadLocal, or thread termination hook using a confined arena.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/31365#discussion_r3895728015