RFR: 8356173: Remove ThreadCritical [v4]

Coleen Phillimore coleenp at openjdk.org
Tue May 13 11:46:52 UTC 2025


On Mon, 12 May 2025 23:10:35 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Remove recursive detection that doesn't work.
>
> src/hotspot/share/memory/arena.cpp line 43:
> 
>> 41: // code and other areas.  For many calls, the current thread has not
>> 42: // been created so we cannot use Mutex.
>> 43: static PlatformMutex* _global_chunk_pool_mutex = nullptr;
> 
> This isn't a class data member, so a leading underscore shouldn't be used.
> https://github.com/openjdk/jdk/blame/b6b5ac1ef9042ed62a8358aa6943b8dc87dcf0ab/doc/hotspot-style.md#L260-L262
> 
> Maybe this falls under:
> https://github.com/openjdk/jdk/blame/b6b5ac1ef9042ed62a8358aa6943b8dc87dcf0ab/doc/hotspot-style.md#L223-L224
> though I think that's rare usage for file-scoped static variables.  Just
> dropping the leading underscore would probably be the most consistent with
> other code.

Hm TIL - I've always used underscores for global static variables.

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

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


More information about the hotspot-dev mailing list