RFR(S): 8248657: Windows: strengthening in ThreadCritical regarding memory model

Ludovic Henry luhenry at microsoft.com
Thu Jul 9 22:19:33 UTC 2020


This small fix is in the context of the larger support for Windows-AArch64. I am using Bernhard Urban's CR as I am currently not an author.

ThreadCritical is used to synchronize the allocation of new Arena chunks. However, on platforms with weaker memory models than x86 (primarily ARM), the original ThreadCritical initialization code would be racy, leading to crashes. To fix that, we switch to initializing the ThreadCritical static data by using a functionally-sound Win32 API focused on initialization [1]. This approach also has the advantage of simplifying the code, and get it closer to how it is done on Linux.

JBS: https://bugs.openjdk.java.net/browse/JDK-8248657
Webrev: http://cr.openjdk.java.net/~burban/luhenry/8248657/webrev.00/
Testing: jtreg:test/hotspot/jtreg:tier1, jtreg:test/jdk:tier1, jtreg:test/jdk:tier2, jtreg:test/langtools on Windows-x86_64, no regressions

Thank you,


[1] https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-initonceinitialize

More information about the hotspot-runtime-dev mailing list