Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8272526

Cleanup ThreadStateTransition class

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 18
    • Fix Version/s: 18
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b12

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pchilanomate Patricio Chilano Mateo
              Reporter:
              pchilanomate Patricio Chilano Mateo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: