JDK-1266426 : isAlive claims main thread is alive after main() returns
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.1
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: solaris_2.4
  • CPU: sparc
  • Submitted: 1996-09-04
  • Updated: 2021-11-09
  • Resolved: 1998-08-27
Related Reports
Relates :  
Description
It seems rather odd that isAlive returns true on the main thread even after main()
returns.  This especially seems odd since I can invoke stop on the main thread without
obvious effect, except that isAlive now returns false.  How special do we want to document
the main thread to be?

Comments
SUGGESTED FIX Set the flag in the main thread so that isAlive returns false after main() returns
11-06-2004

PUBLIC COMMENTS Thread.isAlive returns true on the main thread evan after main() returns normally; however, Thread.isAlive returns false on that thread if the main thread is explicitly stopped. In both cases Thread.isAlive should return true.
10-06-2004

EVALUATION Need to set stillborn bit after main thread returns. Sheng thinks there is some other stuff that should be done, using the new invocation API. All this should wait until we've cleaned up the exception stuff, though, because of various dependencies. timothy.lindholm@Eng 1996-12-03 This bug seems to have been fixed at some point in the past year and a half, so I'm closing it out. joshua.bloch@Eng 1998-08-27
03-12-1996