mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-04 12:08:36 +00:00
6535104: TEST_BUG: FindDeadlocks.java fails intermittently
Retry a few times to check thread status before reporting failure Reviewed-by: swamyv
This commit is contained in:
parent
dd2d72ea50
commit
26e0c238dd
@ -83,11 +83,24 @@ public class SynchronizerDeadlock {
|
||||
|
||||
void waitUntilDeadlock() {
|
||||
barr.await();
|
||||
// sleep a little while to wait until threads are blocked.
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
// ignore
|
||||
|
||||
for (int i=0; i < 100; i++) {
|
||||
// sleep a little while to wait until threads are blocked.
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
// ignore
|
||||
}
|
||||
boolean retry = false;
|
||||
for (Thread t: dThreads) {
|
||||
if (t.getState() == Thread.State.RUNNABLE) {
|
||||
retry = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!retry) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
* monitors.
|
||||
* @author Mandy Chung
|
||||
*
|
||||
* @build ThreadDump
|
||||
* @build ThreadDump Utils
|
||||
*/
|
||||
|
||||
import java.lang.management.*;
|
||||
@ -63,6 +63,9 @@ public class SynchronizerLockingThread extends Thread {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
Utils.waitForBlockWaitingState(t1);
|
||||
Utils.waitForBlockWaitingState(t2);
|
||||
}
|
||||
|
||||
static long[] getThreadIds() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user