RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v3]

Brent Christian bchristi at openjdk.org
Wed Feb 22 19:04:49 UTC 2023


On Wed, 22 Feb 2023 18:57:00 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> The cleaning action would not have access to the isShutdown() instance method of the (Phantom-reachable) AutoShutdownDelegatedExecutorService.
>
>> The cleaning action would not have access to the isShutdown() instance method of the (Phantom-reachable) AutoShutdownDelegatedExecutorService.
> 
> The cleaning action has a reference to the delegate (the underlying ExecutorService) so it can test if it shutdown as Daniel suggests - it's more of an optimization to avoid doing a second call to shutdown in a privileged action.

OK, right

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

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


More information about the core-libs-dev mailing list