RFR: 8356173: Remove ThreadCritical [v4]

Kim Barrett kbarrett at openjdk.org
Mon May 12 23:13:55 UTC 2025


On Mon, 12 May 2025 12:15:09 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Updated the description in the bug.  This removes the last use of ThreadCritical and replaces it with a global PlatformMutex lock.
>> Tested with tier1-4, and tier1 on all Oracle-supported OSs.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove recursive detection that doesn't work.

Changes requested by kbarrett (Reviewer).

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.

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

PR Review: https://git.openjdk.org/jdk/pull/25072#pullrequestreview-2834808163
PR Review Comment: https://git.openjdk.org/jdk/pull/25072#discussion_r2085653726


More information about the hotspot-dev mailing list