mirror of
https://github.com/openjdk/jdk.git
synced 2026-06-08 19:45:12 +00:00
7143070: test/java/awt/print/PaintSetEnabledDeadlock/PaintSetEnabledDeadlock.java freezes on exit
Reviewed-by: anthony
This commit is contained in:
parent
9fbc16e840
commit
2ac69799ec
@ -54,9 +54,12 @@ public class PaintSetEnabledDeadlock extends Frame {
|
||||
Util.clickOnComp(frame.button, robot);
|
||||
}
|
||||
|
||||
frame.panel.stop();
|
||||
boolean ret = frame.panel.stop();
|
||||
frame.dispose();
|
||||
|
||||
if (!ret) {
|
||||
throw new RuntimeException("Test failed!");
|
||||
}
|
||||
System.out.println("Test passed.");
|
||||
}
|
||||
|
||||
@ -140,17 +143,19 @@ class TestPanel extends Panel implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
public boolean stop() {
|
||||
active = false;
|
||||
try {
|
||||
synchronized (sync) {
|
||||
sync.notify();
|
||||
}
|
||||
synchronized (thread) {
|
||||
thread.wait();
|
||||
sync();
|
||||
thread.join(1000);
|
||||
if (thread.isAlive()) {
|
||||
thread.interrupt();
|
||||
return false;
|
||||
}
|
||||
} catch (InterruptedException ex) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void draw() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user