JDK-4528152 : (thread spec) Do unstarted daemon threads prevent VM termination?
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 2001-11-16
  • Updated: 2022-06-18
  • Resolved: 2022-06-18
Related Reports
Relates :  
Description

Name: skR10005			Date: 11/16/2001


It seems the merlin API spec for class Thread is incomplete.
It reads:
  "The Java Virtual Machine continues to execute threads until either 
  of the following occurs: 
     The exit method of class Runtime has been called and the security 
       manager has permitted the exit operation to take place. 
     All threads that are not daemon threads have died, either by 
       returning from the call to the run method or by throwing
       an exception that propagates beyond the run method."
But there is no mention about non-daemon threads which are not started.
They have not died as described in spec but java terminates its execution.
Does this contradict to the spec?
I think this issue should be clarified in the spec.

======================================================================

Comments
Thread and ThreadGroup have been significantly re-specified in Java 19. The updated Thread javadoc makes it clear that unstarted non-daemon threads do not prevent the Java virtual machine from terminating. So I think we can close this issue.
18-06-2022

EVALUATION Minor spec clarification. This is one of many such problems with the the Thread/ThreadGroup spec. ###@###.### 2001-11-16
16-11-2001