Fixed possible race condition in short-lived synchrynous commands
This commit is contained in:
parent
b11bd4fd1e
commit
900ce2f91c
|
|
@ -429,9 +429,11 @@ public class ApiConnection {
|
|||
|
||||
private List<Result> getResults() throws ApiCommandException, ApiConnectionException {
|
||||
try {
|
||||
synchronized (this) {
|
||||
synchronized (this) { // don't wait if we already have a result.
|
||||
if ((err == null) && results.isEmpty()) {
|
||||
wait();
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException ex) {
|
||||
throw new ApiConnectionException(ex.getMessage(), ex);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue