[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-runtime-dev
Subject:    Request for review: 6566340 - restore use of stillborn flag
From:       David.Holmes () oracle ! com (David Holmes)
Date:       2011-01-22 3:26:23
Message-ID: 4D3A4E5F.8060607 () oracle ! com
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic