fix: Move this call to "wait()" into a synchronized block to be sure the monitor on "this" is held.
@@ -54,6 +54,7 @@ public class OkHttp3ResponseFuture implements Future<Object> {
throw new TimeoutException();
} else {
for (;;) {
+ synchronized (this) {
wait(waitTime);
if (this.completed) {
return getResult();
@@ -65,6 +66,7 @@ public class OkHttp3ResponseFuture implements Future<Object> {
}
}
}
+ }
}
