From 9dc1e6edefaf3b7625da3b11f13c1186a6fda36f Mon Sep 17 00:00:00 2001 From: Wiebe Cazemier Date: Mon, 22 Nov 2021 20:04:04 +0100 Subject: [PATCH] Publish retained messages out of subscriptions lock --- subscriptionstore.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/subscriptionstore.cpp b/subscriptionstore.cpp index 7dbfeba..7c5ca5b 100644 --- a/subscriptionstore.cpp +++ b/subscriptionstore.cpp @@ -144,12 +144,11 @@ void SubscriptionStore::addSubscription(std::shared_ptr &client, const s { const std::shared_ptr &ses = session_it->second; deepestNode->addSubscriber(ses, qos); + lock_guard.unlock(); uint64_t count = giveClientRetainedMessages(ses, subtopics, qos); client->getThreadData()->incrementSentMessageCount(count); } } - - lock_guard.unlock(); } void SubscriptionStore::removeSubscription(std::shared_ptr &client, const std::string &topic) -- libgit2 0.21.4