RFR: 8305425: Thread.isAlive0 doesn't need to call into the VM [v6]

Alan Bateman alanb at openjdk.org
Wed Apr 5 06:56:13 UTC 2023


On Wed, 5 Apr 2023 04:35:27 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/Thread.java line 1846:
>> 
>>> 1844:     /**
>>> 1845:      * Returns true if this thread is alive.
>>> 1846:      * This method is non-final so it can be overridden.
>> 
>> Suggestion:
>> 
>>      * This method is non-final so it can be overridden by VirtualThread.
>
> :) I actually made that change in an earlier commit but decided to revert it because I assumed (@AlanBateman can confirm or refute) that it was left unspecific in case classes other than VirtualThread needed to override it.

isAlive is final so it delegates to an overridable method to allow for other implementations. Right now, it's just VirtualThread but the alt implementation might have to override it too. I think the comment can be left as it is.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13287#discussion_r1158093009



More information about the build-dev mailing list