RFR: 8356173: Remove ThreadCritical [v2]
Coleen Phillimore
coleenp at openjdk.org
Fri May 9 20:43:50 UTC 2025
On Fri, 9 May 2025 20:23:28 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> Note that such a simple solution would also reduce the number of indirections when using this mutex. One less pointer load, one less memory access.
>
> @tstuefe We can't rely on PlatformMutex being initialized that way, because the Windows implementation
> requires a _call_ to `InitializeCriticalSection`.
I didn't know this about Windows. The Windows code seemed fine with the static PlatformMutex. The posix code calls pthread_mutex_init with an parameter that's initialized in os::init() -> pthread_init_common();
If I call pthread_init_common() in all the places that _mutexAttr and condAttr are used, the macosx platform is happier. And I can make PlatformMutex static and remove that initialize_chunk_pool() function. I don't think this is a nice change though.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25072#discussion_r2082462842
More information about the hotspot-dev
mailing list