RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v3]
Alan Bateman
alanb at openjdk.org
Wed Feb 22 16:17:11 UTC 2023
> Executors.newSingleThreadExecutor returns a delegating ExecutorService that has finalizer to shutdown the underlying TPE when the wrapper is finalizable. It goes back to JDK 6 and JDK-6399443. This is the last non-empty finalizer in java.base. Removing it will likely lead to bug reports/complaints as the current behavior goes back to 2006. So the proposal is to just replace it with a Cleaner, trivially done in this case. As part of the changes, I've replaced the existing test with a more modern test that exercises more scenarios.
Alan Bateman has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
- Keep reference to Cleanable
- Merge
- Fix typo in comment, remove blank line
- Replace older test
- Initial commit
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/12675/files
- new: https://git.openjdk.org/jdk/pull/12675/files/3bb4d0cd..3b135f09
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=12675&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=12675&range=01-02
Stats: 2384 lines in 99 files changed: 1621 ins; 425 del; 338 mod
Patch: https://git.openjdk.org/jdk/pull/12675.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/12675/head:pull/12675
PR: https://git.openjdk.org/jdk/pull/12675
More information about the core-libs-dev
mailing list