Re: Code Review 7021010: java/lang/Thread/ThreadStateTest.java fails intermittently

2011-06-23 Thread Mandy Chung
David, Thanks for taking a closer look. Really appreciate your detailed review. On 6/23/11 1:33 PM, David Holmes wrote: Sorry for the delay on this ... I concur with Mandy that using arrive() the thread must always be RUNNABLE or the expected next state. Hence the new check is ok. With the

Re: Code Review 7021010: java/lang/Thread/ThreadStateTest.java fails intermittently

2011-06-23 Thread David Holmes
Chris Hegarty said the following on 06/23/11 20:22: On 06/23/11 06:33 AM, David Holmes wrote: Sorry for the delay on this ... I concur with Mandy that using arrive() the thread must always be RUNNABLE or the expected next state. Hence the new check is ok. Thanks David, With the new

Re: Code Review 7021010: java/lang/Thread/ThreadStateTest.java fails intermittently

2011-06-22 Thread David Holmes
Sorry for the delay on this ... I concur with Mandy that using arrive() the thread must always be RUNNABLE or the expected next state. Hence the new check is ok. With the new synchronization (and perhaps even the old) it seems to me that here: private void setState(int newState) {

Re: Code Review 7021010: java/lang/Thread/ThreadStateTest.java fails intermittently

2011-06-21 Thread Mandy Chung
Hi Chris, On 6/20/11 8:54 PM, Chris Hegarty wrote: java/lang/Thread/ThreadStateTest.java can fail with when checkThreadState finds an unexpected state. Exception in thread main java.lang.RuntimeException: MyThread expected to have TERMINATED but got RUNNABLE at

Re: Code Review 7021010: java/lang/Thread/ThreadStateTest.java fails intermittently

2011-06-21 Thread David Holmes
Mandy Chung said the following on 06/21/11 20:08: On 6/20/11 8:54 PM, Chris Hegarty wrote: java/lang/Thread/ThreadStateTest.java can fail with when checkThreadState finds an unexpected state. Exception in thread main java.lang.RuntimeException: MyThread expected to have TERMINATED but got

Re: Code Review 7021010: java/lang/Thread/ThreadStateTest.java fails intermittently

2011-06-21 Thread Chris Hegarty
Thanks Alan, David, Mandy for you comments. The retry loop in checkThreadState make sense. Is the 100ms sleep a bit excessive? The thread will likely get to the expected state in a fraction of that time. True, reduced to 10ms. I'm not sure the extra check in checkThreadState that the

Re: Code Review 7021010: java/lang/Thread/ThreadStateTest.java fails intermittently

2011-06-21 Thread Chris Hegarty
On 06/21/11 12:12 PM, Chris Hegarty wrote: Thanks Alan, David, Mandy for you comments. The retry loop in checkThreadState make sense. Is the 100ms sleep a bit excessive? The thread will likely get to the expected state in a fraction of that time. True, reduced to 10ms. Oh, I also

Re: Code Review 7021010: java/lang/Thread/ThreadStateTest.java fails intermittently

2011-06-21 Thread Mandy Chung
On 6/21/11 7:12 PM, Chris Hegarty wrote: [...] I'm not sure the extra check in checkThreadState that the thread must be RUNNABLE is valid. What if you are transitioning the thread from a blocked to non-blocked state, you may still see it blocked on the first call to getState. L130-116: I

Re: Code Review 7021010: java/lang/Thread/ThreadStateTest.java fails intermittently

2011-06-20 Thread Alan Bateman
Chris Hegarty wrote: java/lang/Thread/ThreadStateTest.java can fail with when checkThreadState finds an unexpected state. Exception in thread main java.lang.RuntimeException: MyThread expected to have TERMINATED but got RUNNABLE at

Re: Code Review 7021010: java/lang/Thread/ThreadStateTest.java fails intermittently

2011-06-20 Thread David Holmes
Hi Chris, Chris Hegarty said the following on 06/20/11 22:54: java/lang/Thread/ThreadStateTest.java can fail with when checkThreadState finds an unexpected state. Exception in thread main java.lang.RuntimeException: MyThread expected to have TERMINATED but got RUNNABLE at