On Fri, 14 Jul 2023 21:31:21 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> AFAIU it's possible in the case when we have terminated VT and 
>> JvmtiVTSuspender is requested to suspend all virtual threads
>
> So there is a window in which a VT is marked as terminated yet is still 
> visible for actions like this? For regular threads we would always have 
> filtered out thread in the process of exiting. Seeing terminated threads 
> seems potentially problematic but perhaps all the VT code is prepared to 
> handle this.

I hope there is no such window in GetThreadState() case, but get_vthread_state 
method is also called from MultipleStackTracesCollector::fill_frames and there 
is a comment there:
// Note that either or both of thr and thread_oop
// may be null if the thread is new or has exited.

I keep this check for safety (though fill_frames does not care about suspend 
bit)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14878#discussion_r1264216410

Reply via email to