JDK-8256643 : Terminally deprecate ThreadGroup stop, destroy, isDestroyed, setDaemon and isDaemon
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-11-19
  • Updated: 2020-12-09
  • Resolved: 2020-11-25
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 16
16 b26Fixed
Related Reports
CSR :  
Relates :  
Sub Tasks
JDK-8256652 :  
Description
This issue tracks terminally deprecating the following methods defined by java.lang.ThreadGroup

- stop
- destroy
- isDestroyed
- setDaemon
- isDaemon

The stop method has been deprecated since=1.2 because it is inherently unsafe. It is time to terminally deprecate this method so it can be removed in a future release. Thread.stop will be examined in a separate issue.

The destroy, isDestroyed, setDaemon, isDaemon methods support the mechanism to explicitly or automatically destroy a thread group. As detailed in JDK-8252885, the mechanism to destroy thread groups is flawed and racy. Furthermore, this mechanism inhibits efforts to drop the reference from a thread group to its threads (so that thread creation, starting and termination do not need to coordinate with their thread group). These methods should be terminally deprecated so they can be removed in a future release.

JDK-8252885 provides usage data from a scan of 100k artifacts in Maven Central.





Comments
Changeset: 79e57ace Author: Alan Bateman <alanb@openjdk.org> Date: 2020-11-25 08:26:00 +0000 URL: https://github.com/openjdk/jdk/commit/79e57ace
25-11-2020