RFR: 8356173: Remove ThreadCritical [v2]

Kim Barrett kbarrett at openjdk.org
Fri May 9 21:17:51 UTC 2025


On Fri, 9 May 2025 20:31:06 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add recursion detection.
>
> src/hotspot/share/nmt/nmtUsage.cpp line 61:
> 
>> 59:     ChunkPoolLocker lock;
>> 60:     ms = MallocMemorySummary::as_snapshot();
>> 61:   }
> 
> Shortening the scope of the lock seems contrary to the comment explaining its presence.

I missed the discussion that suggested this shortening before commenting.  I guess the snapshot
is what provides the atomicity for the remainder, so shortening the scope seems okay after all.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25072#discussion_r2082507628


More information about the hotspot-dev mailing list