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

Rework thread initialization and teardown logic

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 12
    • Fix Version/s: 13
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b02

      Description

      A few cleanups to make init and tear-down clearer for both NonJavaThreads and JavaThreads. In particular:

      - Move NJT-list management to init/tear-down of the active thread, instead of constructor/destructor
      - Factor out common code across different kinds of NJTs
      - Make it easier to add init/teardown code across thread types

      Proposed approach in non-virtual call_run:

      void call_run() {
        // common init for all threads
        ...
        // virtual init
        this->pre_run();

        this_run();

        // common teardown

        // virtual teardown
        this->post_run()
        
        // Note: can't reference 'this' here as post_run may have deleted it
        ...
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dholmes David Holmes
                Reporter:
                dholmes David Holmes
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: