mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-10 18:15:58 +01:00
First check condition, then remaining wait in SynchronizationPoint
as otherwhise SynchronizationPoint may report NoResponseException when there was in fact a success or failure reported in case there are multiple threads waiting for the condition.
This commit is contained in:
parent
83aa6838d9
commit
cca34fd872
1 changed files with 1 additions and 2 deletions
|
@ -221,12 +221,11 @@ public class SynchronizationPoint<E extends Exception> {
|
|||
long remainingWait = TimeUnit.MILLISECONDS.toNanos(connection.getPacketReplyTimeout());
|
||||
while (state == State.RequestSent || state == State.Initial) {
|
||||
try {
|
||||
remainingWait = condition.awaitNanos(
|
||||
remainingWait);
|
||||
if (remainingWait <= 0) {
|
||||
state = State.NoResponse;
|
||||
break;
|
||||
}
|
||||
remainingWait = condition.awaitNanos(remainingWait);
|
||||
} catch (InterruptedException e) {
|
||||
LOGGER.log(Level.WARNING, "Thread interrupt while waiting for condition or timeout ignored", e);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue