RFR: 8366671: Refactor Thread::SpinAcquire and Thread::SpinRelease [v15]

Anton Artemov aartemov at openjdk.org
Mon Dec 8 12:56:53 UTC 2025


> Hi, 
> 
> please consider the following changes:
> 
> In this PR `Thread::SpinAcquire()` and `Thread::SpinRelease()` methods are refactored into a utility class `SpinCriticalSection`. The motivation is to make it easier for developers to use this lightweight synchronization mechanism in the codebase. The two aforementioned methods were used in JFR to create short critical sections with a helper class, but that was not the case for the object monitor code. 
> 
> Tested in tiers 1 - 5.

Anton Artemov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 19 additional commits since the last revision:

 - Merge remote-tracking branch 'origin/master' into JDK-8366671-refactor-spin-acquire-spin-release
 - 8366671: Use non-safe current_or_null.
 - Update src/hotspot/share/runtime/objectMonitor.cpp
   
   Co-authored-by: Coleen Phillimore <coleen.phillimore at oracle.com>
 - 8366671: Added NoSafepointVerifier
 - 8366671: Modified the comment.
 - Merge remote-tracking branch 'origin/master' into JDK-8366671-refactor-spin-acquire-spin-release
 - 8366671: Addressed reviewer's comments.
 - 8366671: Addressed reviewers' comments.
 - 8366671: Addressed reviewer's comments
 - 8366671: Removed redundant include.
 - ... and 9 more: https://git.openjdk.org/jdk/compare/3c241263...7e0cf5a5

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/28264/files
  - new: https://git.openjdk.org/jdk/pull/28264/files/a40f6d81..7e0cf5a5

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28264&range=14
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28264&range=13-14

  Stats: 21464 lines in 497 files changed: 12414 ins; 6894 del; 2156 mod
  Patch: https://git.openjdk.org/jdk/pull/28264.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28264/head:pull/28264

PR: https://git.openjdk.org/jdk/pull/28264


More information about the hotspot-dev mailing list