Skip to content

Commit

Permalink
8309506: com/sun/jdi/MultiBreakpointsTest.java fails with virtual tes…
Browse files Browse the repository at this point in the history
…t thread factory

Reviewed-by: amenkov, sspitsyn
  • Loading branch information
plummercj committed Jun 6, 2023
1 parent 7d1147e commit 571fbdc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
1 change: 0 additions & 1 deletion test/jdk/ProblemList-Virtual.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 14 additions & 5 deletions test/jdk/com/sun/jdi/MultiBreakpointsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,16 @@
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);
}
}
}

Expand Down Expand Up @@ -127,16 +135,15 @@ void bkpt27() {}
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);

// Create the threads
//
//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 {
Expand Down Expand Up @@ -188,9 +195,11 @@ public void run() {
}
}
}
};
);
thrd.setName(threadName);
thrd.setPriority(Thread.MAX_PRIORITY-1);
thrd.start();
return thrd;
}
}

Expand Down

1 comment on commit 571fbdc

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.