On Tue, 8 Nov 2022 12:30:37 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:

>> The JVM code took a ThreadGroup lock before poking into ThreadGroup fields.  
>> Call a method in the ThreadGroup to call the synchronized method instead.
>> Tested with tier 1-4.
>
> Coleen Phillimore has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Handle non OOM exceptions and rename subgroupsAsArray.

I wonder if the intermediate resource array is needed now. With the change, 
subgroupsAsArray returns a Java array,  JvmtiEnvBase::get_subgroups creates a 
resource array with a handle to each of the thread group oops, then 
JvmtiEnvBase::new_jthreadArray creates a new local ref for each group.

src/java.base/share/classes/java/lang/ThreadGroup.java line 796:

> 794: 
> 795:     /**
> 796:      * Returns an snapshot of the subgroups as an array, used by JVMTI.

The update looks good, just a typo here where it should be "a snapshot".

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

PR: https://git.openjdk.org/jdk/pull/11033

Reply via email to