test/java/awt/print/PaintSetEnabledDeadlock/PaintSetEnabledDeadlock.java

Print this page

        

*** 52,64 **** for (int i = 0; i < 20; ++i) { Util.clickOnComp(frame.panel, robot); Util.clickOnComp(frame.button, robot); } ! frame.panel.stop(); frame.dispose(); System.out.println("Test passed."); } public PaintSetEnabledDeadlock() { super("7108598 test"); --- 52,67 ---- for (int i = 0; i < 20; ++i) { Util.clickOnComp(frame.panel, robot); Util.clickOnComp(frame.button, robot); } ! boolean ret = frame.panel.stop(); frame.dispose(); + if (!ret) { + throw new RuntimeException("Test failed!"); + } System.out.println("Test passed."); } public PaintSetEnabledDeadlock() { super("7108598 test");
*** 138,158 **** draw(); } } } ! public void stop() { active = false; try { ! synchronized (sync) { ! sync.notify(); ! } ! synchronized (thread) { ! thread.wait(); } } catch (InterruptedException ex) { } } public void draw() { synchronized (getTreeLock()) { if (image != null) { --- 141,163 ---- draw(); } } } ! public boolean stop() { active = false; try { ! sync(); ! thread.join(1000); ! if (thread.isAlive()) { ! thread.interrupt(); ! return false; } } catch (InterruptedException ex) { + return false; } + return true; } public void draw() { synchronized (getTreeLock()) { if (image != null) {