1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +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(); connectionLock.lock();
try { try {
state = State.Success; state = State.Success;
condition.signal(); condition.signalAll();
} }
finally { finally {
connectionLock.unlock(); connectionLock.unlock();
@ -174,7 +174,7 @@ public class SynchronizationPoint<E extends Exception> {
try { try {
state = State.Failure; state = State.Failure;
this.failureException = failureException; this.failureException = failureException;
condition.signal(); condition.signalAll();
} }
finally { finally {
connectionLock.unlock(); connectionLock.unlock();