`G1ConcurrentMark::finalize_marking` uses `StrongRootsScope` before creating `G1CMRemarkTask`. The actual required logic inside `StrongRootsScope` is threads-claim-token. One can use `ThreadsClaimTokenScope` inside `G1CMRemarkTask` directly to make the intention explicit and closer to where it's used, `possibly_parallel_threads_do` in the `work()` method.
- links to
-
Review(master) openjdk/jdk/27385