RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v3]
Alan Bateman
alanb at openjdk.org
Wed Feb 22 18:59:45 UTC 2023
On Wed, 22 Feb 2023 18:41:13 GMT, Brent Christian <bchristi at openjdk.org> wrote:
> 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's suggests - it's more of an optimization to avoid doing a second call to shutdown in a privileged action.
-------------
PR: https://git.openjdk.org/jdk/pull/12675
More information about the core-libs-dev
mailing list