RFR: 8263903: Use Cleaner instead of finalize to auto stop Timer thread [v2]
Alan Bateman
alanb at openjdk.java.net
Mon Mar 22 11:45:40 UTC 2021
On Mon, 22 Mar 2021 07:19:28 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> Please review this change to java.util.Timer, replacing the use of deprecated finalization-based cleanup with use of java.lang.ref.Cleaner.
>>
>> In addition, Timer.cancel now cancels any later execution of the the no longer relevant cleanup.
>>
>> Testing:
>> mach5 tier1
>> New AutoStop test verifies the specified cleanup behavior.
>> (There are existing tests involving Timer.cancel.)
>
> Kim Barrett has updated the pull request incrementally with one additional commit since the last revision:
>
> dholmes review
The update to java.util.Timer looks okay. A minor comment is that the ThreadReaper constructor does not need to be public.
-------------
Marked as reviewed by alanb (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/3106
More information about the core-libs-dev
mailing list