JDK-8272526 : Cleanup ThreadStateTransition class
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-08-16
  • Updated: 2021-11-09
  • Resolved: 2021-08-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 18
18 b12Fixed
Related Reports
Relates :  
Description
The only transitions covered by the generic transition() public method are transitions from vm to either java or native. Other ones are already covered by methods transition_from_java and transition_from_native or are invalid transitions. Defining a specific transition_from_vm method and removing the generic transition will allow for the following:

- Make it more clear which actions we need to perform when transitioning from one state to another.
- Allow factoring out common code for some transitions like from vm to a safe state(native, blocked) or from native and from vm to java which both need to call process_if_requested_with_exit_check.
- Make the public API of ThreadStateTransition more consistent providing the 3 methods that we will ever need when making transitions: transition_from_java, transition_from_native and transition_from_vm. The transition from new is a special case only executed once for which we don't need a special transition method. Transitions from thread_blocked should only be done in ThreadBlockInVMPreprocess/ThreadBlockInVM, since we should avoid manual transitions to thread_blocked except in special places like safepoint and handshake code.
Comments
Changeset: 74543069 Author: Patricio Chilano Mateo <pchilanomate@openjdk.org> Date: 2021-08-24 14:09:59 +0000 URL: https://git.openjdk.java.net/jdk/commit/7454306920bcd9e4397de32fae2fdf4ec688bded
24-08-2021