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

Alan Bateman alanb at openjdk.org
Wed Feb 22 18:20:19 UTC 2023


On Wed, 22 Feb 2023 17:20:21 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

> Hmmm... so now shutdown no longer requires permission. You should probably call super.shutdown() before invoking cleaner.clean(), assuming that shutdown() can be called twice. You could modify the cleanup action to only call shutdown() if isShutdown() returns false.

That's right. It will be a non-issue once the SM goes away but while that execution mode is supported then the shutdown method and the cleaner action have to be different (as it was initially).

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

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


More information about the core-libs-dev mailing list