Request for review: 6566340 - restore use of stillborn flag (original) (raw)
David Holmes David.Holmes at oracle.com
Fri Jan 21 19:26:23 PST 2011
- Previous message: hg: jdk7/hotspot-rt/hotspot: 13 new changesets
- Next message: hg: jdk7/hotspot-rt/hotspot: 6566340: Restore use of stillborn flag to signify a thread that was stopped before it started
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
This has already gone through internal review, just putting it out in the open prior to committing next week.
http://cr.openjdk.java.net/~dholmes/6566340/
Okay this is blast from the past but it's an enabler for the library folks cleaning up some messy code in Thread.java
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.
Thanks, David
- Previous message: hg: jdk7/hotspot-rt/hotspot: 13 new changesets
- Next message: hg: jdk7/hotspot-rt/hotspot: 6566340: Restore use of stillborn flag to signify a thread that was stopped before it started
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]