On Fri, 20 Nov 2020 14:05:09 GMT, Sean Mullan <mul...@openjdk.org> wrote:
>> This change terminally deprecates 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 degraded in a future >> release and eventually removed. >> >> CSR with more information: https://bugs.openjdk.java.net/browse/JDK-8256644 > > src/java.base/share/classes/java/lang/ThreadGroup.java line 191: > >> 189: * @deprecated Destroying a thread group and its subgroups is not >> an atomic >> 190: * operation and is inherently racy with respect to >> threads that >> 191: * have been created but not have started. The concept >> of daemon > > "a daemon group" sounds better to me. The existing spec uses "daemon thread group" so I'd prefer to stick with that. > src/java.base/share/classes/java/lang/ThreadGroup.java line 208: > >> 206: * @deprecated Destroying a thread group and its subgroups is not >> an atomic >> 207: * operation and is inherently racy with respect to >> threads that >> 208: * have been created but not have started. The ability >> to explicitly > > "have not started" Thanks, there's a typo there. ------------- PR: https://git.openjdk.java.net/jdk/pull/1318