Fixed potential indefinite lock retention

This commit is contained in:
andsel
2012-08-03 15:44:11 +02:00
parent 41f03b2d3e
commit f18ba2e248
@@ -45,6 +45,7 @@ public class SimpleMessaging implements IMessaging {
Subscription newSubscription = new Subscription(clientId, topic, qos);
rwLock.writeLock().lock();
if (subscriptions.contains(newSubscription)) {
rwLock.writeLock().unlock();
return;
}
subscriptions.add(newSubscription);