* @param <R>
* The type of the high-level operation result
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
- * @version $Id$
*/
public class HighLevelCallback<R extends HighLevelResult> {
*/
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();
}