On Wed, 5 Oct 2022 19:58:24 GMT, Alan Bateman <al...@openjdk.org> wrote:

>> It's not a matter of whether or not the test needs to restore it. It _will_ 
>> restore it if there is a GC, and if this happens before the test completes, 
>> it could find itself without enough carrier threads.
>
> No, restoration requires a call to close. Maybe you are assuming that 
> AutoCloseable implementations setup a cleaner to do that?

Yes, that was my point of confusion. I thought collection triggered calling 
close, but I see now when you want it to be closed, you rely on 
try-with-resources to call close() method.

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

PR: https://git.openjdk.org/jdk/pull/10562

Reply via email to