mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 12:02:05 +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:
parent
57fa631480
commit
83aa6838d9
1 changed files with 2 additions and 2 deletions
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue