8309506: com/sun/jdi/MultiBreakpointsTest.java fails with virtual test thread factory

Reviewed-by: amenkov, sspitsyn
This commit is contained in:
Chris Plummer 2023-06-06 18:17:47 +00:00
parent 7d1147ee5c
commit 571fbdc311
2 changed files with 14 additions and 6 deletions

View File

@ -30,7 +30,6 @@ com/sun/jdi/EATests.java#id0 8264699 generic-
com/sun/jdi/ExceptionEvents.java 8278470 generic-all
com/sun/jdi/JdbMethodExitTest.java 8285422 generic-all
com/sun/jdi/MethodEntryExitEvents.java 8285422 generic-all
com/sun/jdi/MultiBreakpointsTest.java 8285422 generic-all
com/sun/jdi/RedefineCrossStart.java 8278470 generic-all
com/sun/jdi/RedefineNestmateAttr/TestNestmateAttr.java 8285422 generic-all
com/sun/jdi/ReferrersTest.java 8285422 generic-all

View File

@ -60,8 +60,16 @@ import java.text.*;
class MultiBreakpointsTarg {
MultiBreakpointsTarg(int numThreads, int numHits) {
Thread threads[] = new Thread[numThreads];
for (int ii = 0; ii < numThreads; ii++) {
console(ii, numHits);
threads[ii] = console(ii, numHits);
}
for (int ii = 0; ii < numThreads; ii++) {
try {
threads[ii].join();
} catch (InterruptedException ie) {
throw new RuntimeException(ie);
}
}
}
@ -127,7 +135,7 @@ class MultiBreakpointsTarg {
void bkpt28() {}
void bkpt29() {}
void console(final int num, final int nhits) {
Thread console(final int num, final int nhits) {
final InputStreamReader isr = new InputStreamReader(System.in);
final BufferedReader br = new BufferedReader(isr);
@ -135,8 +143,7 @@ class MultiBreakpointsTarg {
//
//final String threadName = "DebuggeeThread: " + num;
final String threadName = "" + num;
Thread thrd = new Thread( threadName ) {
public void run() {
Thread thrd = TestScaffold.newThread(() -> {
synchronized( isr ) {
boolean done = false;
try {
@ -188,9 +195,11 @@ class MultiBreakpointsTarg {
}
}
}
};
);
thrd.setName(threadName);
thrd.setPriority(Thread.MAX_PRIORITY-1);
thrd.start();
return thrd;
}
}