*/
public R getResult(long waitTime) throws InterruptedException {
synchronized (syncObject) {
- if (!resultComplete) {
+ while (!resultComplete) {
syncObject.wait(waitTime);
}
return result;
return;
}
resultComplete = true;
- syncObject.notify();
+ syncObject.notifyAll();
}
fireGotResult();
}