RFR: 8356173: Remove ThreadCritical

Coleen Phillimore coleenp at openjdk.org
Fri May 9 14:58:52 UTC 2025


On Fri, 9 May 2025 12:57:35 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> Why do we even need dynamic initialization here? I thought that is the tradeoff with PlatformMutex: you forego deadlock checks etc, but you gain safety wrt initialisation.
>> That would also save some instructions.
>
> You can use `Deferred<T>`, but as `PlatformMutex` is at "the bottom" of the initialization order it's not necessary, as Thomas notes. I'd be happy to see it use `Deferred<T>`, as it can help with debugging if PlatformMutex ever changes.

Not really crazy about the Deferred<> name and that change is still under consideration.

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

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


More information about the hotspot-dev mailing list