1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-16 12:12:06 +01:00

Use signalAll in SynchronizationPoint

to prevent a thread from not being notified about a change of the state
of the SynchronizationPoint.

If two threads are waiting for a change, which could happen e.g. because
of a connectivity change and one thread does instantShutdown() while the
other handles connectionClosedOnError(), then only one thread, usually
the one handling connectionClosedOnError(), would be notified and
resumed.

Fixes SMACK-652.
This commit is contained in:
Florian Schmaus 2015-04-06 17:38:51 +02:00
parent 57fa631480
commit 83aa6838d9

View file

@ -153,7 +153,7 @@ public class SynchronizationPoint<E extends Exception> {
connectionLock.lock();
try {
state = State.Success;
condition.signal();
condition.signalAll();
}
finally {
connectionLock.unlock();
@ -174,7 +174,7 @@ public class SynchronizationPoint<E extends Exception> {
try {
state = State.Failure;
this.failureException = failureException;
condition.signal();
condition.signalAll();
}
finally {
connectionLock.unlock();