tools/Jemmy/JemmyFX/src/org/jemmy/fx/QueueExecutor.java
Print this page
@@ -220,21 +220,22 @@
action = null;
parameters = null;
}
public boolean failed() {
- return action.failed();
+ return !done || action.failed();
}
public Throwable getThrowable() {
return action.getThrowable();
}
public synchronized void waitDone(Timeout timeout) {
try {
- while (!done) {
- wait(timeout.getValue());
+ long maxTime = System.currentTimeMillis() + timeout.getValue();
+ while (!done && System.currentTimeMillis() < maxTime) {
+ wait(maxTime - System.currentTimeMillis());
}
} catch (InterruptedException ex) {
}
}
}