On Sun, 21 Mar 2021 22:57:10 GMT, David Holmes <[email protected]> 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.)
>
> test/jdk/java/util/Timer/AutoStop.java line 47:
>
>> 45: public void run() {
>> 46: tdThread = Thread.currentThread();
>> 47: synchronized(wakeup) {
>
> tdThread should be set inside the sync block, and then doesn't need to be
> declared volatile
Without volatile is the while loop still okay? And the read for the join call?
-------------
PR: https://git.openjdk.java.net/jdk/pull/3106