提交 6151897f 编写于 作者: B bagiras

7143070: test/java/awt/print/PaintSetEnabledDeadlock/PaintSetEnabledDeadlock.java freezes on exit

Reviewed-by: anthony
上级 cb2620b5
...@@ -54,9 +54,12 @@ public class PaintSetEnabledDeadlock extends Frame { ...@@ -54,9 +54,12 @@ public class PaintSetEnabledDeadlock extends Frame {
Util.clickOnComp(frame.button, robot); Util.clickOnComp(frame.button, robot);
} }
frame.panel.stop(); boolean ret = frame.panel.stop();
frame.dispose(); frame.dispose();
if (!ret) {
throw new RuntimeException("Test failed!");
}
System.out.println("Test passed."); System.out.println("Test passed.");
} }
...@@ -140,17 +143,19 @@ class TestPanel extends Panel implements Runnable { ...@@ -140,17 +143,19 @@ class TestPanel extends Panel implements Runnable {
} }
} }
public void stop() { public boolean stop() {
active = false; active = false;
try { try {
synchronized (sync) { sync();
sync.notify(); thread.join(1000);
} if (thread.isAlive()) {
synchronized (thread) { thread.interrupt();
thread.wait(); return false;
} }
} catch (InterruptedException ex) { } catch (InterruptedException ex) {
return false;
} }
return true;
} }
public void draw() { public void draw() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册