Avoid race condition in waitComplete.
@@ -228,8 +228,10 @@ public final class SourceSession implements ReplyHandler, Runnable {
Result waitComplete() throws InterruptedException {
synchronized (this) {
+ while (result == null) {
this.wait();
}
+ }
return result;
}
}
