Fixed potential indefinite lock retention
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user