Skip to content
Permalink
Browse files
8264672: runtime/ParallelLoad/ParallelSuperTest.java timed out
Reviewed-by: hseigel, lfoltan, dholmes
  • Loading branch information
Coleen Phillimore committed Apr 8, 2021
1 parent ec599da commit 255afbea92e7fda571e6e78efca4dabc88238df6
Showing with 7 additions and 0 deletions.
  1. +7 −0 test/hotspot/jtreg/runtime/ParallelLoad/MyLoader.java
@@ -61,6 +61,7 @@ public Class loadClass(String name) throws ClassNotFoundException {
private static boolean parallel = false;
private Object sync = new Object();
private Object thread_sync = new Object();
private static volatile boolean waiting = false;

private void makeThreadWait() {
if (!parallel) { return; }
@@ -73,6 +74,7 @@ private void makeThreadWait() {
synchronized(sync) {
try {
ThreadPrint.println("t1 waits parallelCapable loader");
waiting = true;
sync.wait(); // Give up lock before request to load B
} catch (InterruptedException e) {}
}
@@ -88,6 +90,11 @@ private void makeThreadWait() {
// Non-parallelCapable class loader thread will be woken up by the jvm.
private void wakeUpThread() {
if (isRegisteredAsParallelCapable()) {
while (!waiting) {
try {
Thread.sleep(1);
} catch (InterruptedException e) {}
}
synchronized(sync) {
sync.notify();
}

1 comment on commit 255afbe

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 255afbe Apr 8, 2021

Please sign in to comment.