From 83aa6838d93eb9baeea36f229c95d4a3665c7667 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 6 Apr 2015 17:38:51 +0200 Subject: [PATCH] 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. --- .../java/org/jivesoftware/smack/SynchronizationPoint.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/SynchronizationPoint.java b/smack-core/src/main/java/org/jivesoftware/smack/SynchronizationPoint.java index 73d4e8b4e..78918a06a 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/SynchronizationPoint.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/SynchronizationPoint.java @@ -153,7 +153,7 @@ public class SynchronizationPoint { connectionLock.lock(); try { state = State.Success; - condition.signal(); + condition.signalAll(); } finally { connectionLock.unlock(); @@ -174,7 +174,7 @@ public class SynchronizationPoint { try { state = State.Failure; this.failureException = failureException; - condition.signal(); + condition.signalAll(); } finally { connectionLock.unlock();