RFR: 8307298: JFR: Ensure jdk.jfr.internal.TypeLibrary is initialized only once [v2]
Robert Toyonaga
duke at openjdk.org
Wed May 10 17:05:42 UTC 2023
On Wed, 10 May 2023 08:45:02 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> Robert Toyonaga has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
>>
>> - Merge branch 'master' of github.com:openjdk/jdk into initialize-TypeLibrary-once
>> - Only init TypeLibrary once
>
> src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java line 103:
>
>> 101: if (initialized) {
>> 102: return;
>> 103: }
>
> Perhaps it would make sense to add a comment as to why that check needs to be there? Something like this perhaps?
>
>
> // TypeLibrary is initialized once by MetadataRepository (which is a singleton). So shouldn't happen practice.
> // However, some tools (GraalVM native image) may call the initialization routine twice.
Good idea. I've added a comment with an explanation.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13760#discussion_r1190184225
More information about the hotspot-jfr-dev
mailing list