On Tue, 18 Aug 2026 09:36:45 GMT, Dean Long <[email protected]> wrote:

> This PR removes the last traces of the obsolete thread transition states such 
> as _thread_new_trans, _thread_blocked_trans, etc.  These states have not been 
> needed ever since the JVM switched safepoints from doing forced suspend to 
> cooperative self-suspend.  Most were no longer used thanks to previous work 
> by @pchilano , but there remained uses of _thread_in_native_trans that are 
> now safely converted into _thread_in_vm.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Looks like a good cleanup. I had forgotten how much of the "trans" state logic 
had already been stripped out. I scanned through all the safepoint related code 
and this comment in safepoint.cpp needs updating now:


 //  5. In VM or Transitioning between states
  //     If a Java thread is currently running in the VM or transitioning
  //     between states, the safepointing code will poll the thread state
  //     until the thread blocks itself when it attempts transitions to a
  //     new state or locking a safepoint checked monitor.

Thanks

src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp line 2056:

> 2054:   //     VM thread changes sync state to synchronizing and suspends 
> threads for GC.
> 2055:   //     Thread A is resumed to finish this native method, but doesn't 
> block here since it
> 2056:   //     didn't see any synchronization is progress, and escapes.

I think the comment is still relevant even if we now switch to the in-vm state 
to achieve it rather than the native-trans state.

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

PR Review: https://git.openjdk.org/jdk/pull/32415#pullrequestreview-4967475072
PR Review Comment: https://git.openjdk.org/jdk/pull/32415#discussion_r3809271054

Reply via email to