[PATCH] Review request: 8004177: test/java/lang/Thread/GenerifyStackTraces.java doesn't clean-up

Alan Bateman Alan.Bateman at oracle.com
Wed May 15 09:38:04 UTC 2013

On 15/05/2013 10:10, Eric Wang wrote:
> Hi,
> Please help to review the fix for bug 8004177 
> <https://jbs.oracle.com/bugs/browse/JDK-8004177> and 8004178 
> <https://jbs.oracle.com/bugs/browse/JDK-8004178>, this fix is to make 
> sure all child threads finished before main thread exits.
> http://cr.openjdk.java.net/~ewang/8004177/webrev.00/ 
> <http://cr.openjdk.java.net/%7Eewang/8004177/webrev.00/>
> For 8004178, the test StackTraces.java is same as 
> GenerifyStackTraces.java, so just remove it.
> Thanks,
> Eric
It's good to have fix this test so that it doesn't leave a thread behind 
(in this case slowing down the execution of subsequent tests by taking 
thread dumps every 2 seconds)

The change you propose is okay but a bit odd to have ThreadOne signal 
DumpThread to shutdown. An alternative would be to have the main thread 
signal DumpThread, as in:


   finished = true;

Better still might be to move the flag into the DumpThread class and 
have it define a shutdown method so the main thread does:



I think that would be a bit cleaner.


More information about the core-libs-dev mailing list