[jdk18] RFR: 8278389: SuspendibleThreadSet::_suspend_all should be volatile/atomic

Thomas Schatzl tschatzl at openjdk.java.net
Fri Dec 10 13:58:39 UTC 2021


Hi all,

  can I have reviews for this change that makes `SuspendibleThreadSet::_suspend_all` volatile and all accesses to it use `Atomic` helpers?

I found that the only getter for that member is called `SuspendibleThreadSet::should_yield()`, which contradicts our naming rules; to keep the change minimal (and the naming discussion out of this PR because I do not feel that `_suspend_all` is particularly good) I introduced a private `suspend_all()` method.
I can of course add some renaming in this change (but then for jdk19+ only).

Testing: gha, local compilation

Thanks,
  Thomas

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

Commit messages:
 - Initial change

Changes: https://git.openjdk.java.net/jdk18/pull/9/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk18&pr=9&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8278389
  Stats: 20 lines in 2 files changed: 5 ins; 1 del; 14 mod
  Patch: https://git.openjdk.java.net/jdk18/pull/9.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk18 pull/9/head:pull/9

PR: https://git.openjdk.java.net/jdk18/pull/9



More information about the hotspot-gc-dev mailing list