RFR: 8373497: SpinCriticalSection should use SpinYield

David Holmes dholmes at openjdk.org
Fri Dec 12 10:42:53 UTC 2025


On Thu, 11 Dec 2025 09:09:05 GMT, Anton Artemov <aartemov at openjdk.org> wrote:

> Hi, please consider the following changes:
> 
> The original code of `Thread::SpinAqcuire()` was moved into a RAII object `SpinCriticalSection` in https://bugs.openjdk.org/browse/JDK-8366671
> 
> It to a great extent duplicates the code of the `SpinYield` class, which is more flexible. In this PR the duplication is removed as `SpinCriticalSection` now makes uses of  `SpinYield`.
> 
> Tested in tiers 1-3.
> 
> Extended performance testing has shown that the change is neutral.

Looks like a good cleanup. Thanks

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28763#pullrequestreview-3569977831


More information about the hotspot-dev mailing list