Rework thread initialization and teardown logic

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 13
    • Affects Version/s: 12
    • Component/s: hotspot
    • b02

      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
        ...
      }

            Assignee:
            David Holmes
            Reporter:
            David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: