RFR(S): 8248657: Windows: strengthening in ThreadCritical regarding memory model
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 . This approach also has the advantage of simplifying the code, and get it closer to how it is done on Linux.
Testing: jtreg:test/hotspot/jtreg:tier1, jtreg:test/jdk:tier1, jtreg:test/jdk:tier2, jtreg:test/langtools on Windows-x86_64, no regressions
More information about the hotspot-runtime-dev