On Thu, 24 Jul 2025 12:31:04 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> The java_thread can be null because the carrier of a mounted vthread was not 
>> contained in the ThreadsListHandle.
>> 
>> The only thing this function guarantees is that if the vthread appeared to 
>> have a carrier and that carrier is protected by the TLH, then the caller can 
>> safely interact with the carrier knowing it can't terminate - same as for 
>> regular threads. The caller has to account for the potential async 
>> mounting/unmounting of  vthread - e.g. by handshaking the reported carrier 
>> and then confirming it is still the carrier.
>
> Note that `java_thread` may already be null so we don't get to execute line 
> 836.

Thanks, David. The potential issue I'm still concerned about is that a 
subsequent handshaking can observe the JavaThread (and virtual thread as well) 
in a VTMS transition when there is no protection with a 
`VTMSTransitionDisabler`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26287#discussion_r2228896900

Reply via email to