Request for review: 6566340 - restore use of stillborn flag

David Holmes David.Holmes at
Fri Jan 21 19:26:23 PST 2011

This has already gone through internal review, just putting it out in 
the open prior to committing next week.

Okay this is blast from the past but it's an enabler for the library
folks cleaning up some messy code in

The basic idea is simple - undo years of misuse and abuse and have the
stillborn flag do what it used to do back in JDK 1.2:

- JVM_StartThread does not, in general, need to guard against starting a 
thread twice (this has been handled at the Java level since JDK 5) but 
there is a small window where you could try to start() a JNI-attached thread
- JVM_StopThread will set the stillborn flag of the java.lang.Thread if
it finds there is no active JavaThread (ie the Thread was not yet
started or already terminated)

- ensure_join does not need to touch the stillborn flag (it hasn't been
used as part of the isAlive logic for many, many years)
- send_thread_stop does not need to touch the stillborn flag, as that is
now done in JVM_StopThread
- thread_main_inner continues to check for pending exceptions or for
being stillborn as before (but the comments are cleaned up). Note this
is the only code that looks at the stillborn flag.


More information about the hotspot-runtime-dev mailing list