JDK-8214097 : Rework thread initialization and teardown logic
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 12
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-11-20
  • Updated: 2023-12-19
  • Resolved: 2018-12-28
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 13
13 b02Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
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
  ...
}
Comments
[jdk11u-fix-request] Approval Request from SUN Guoyun Fix Request jdk11u Applies not cleanly. manually modify src/hotspot/share/runtime/thread.cpp, src/hotspot/share/services/management.cpp. Do not merged test/hotspot/gtest/threadHelper.inline.hpp. test tier1-3 passed.
19-12-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/2411 Date: 2023-12-19 09:49:22 +0000
19-12-2023

This isn't suitable as an OpenJDK 11u backport.
19-12-2023

URL: http://hg.openjdk.java.net/jdk/jdk/rev/67e3a8b3449c User: dholmes Date: 2018-12-28 03:48:04 +0000
28-12-2018