lock_guard: remove explicit template

Change-Id: Iec6d57d6a66557a66096c7a8f67e025c6ca5a64c
diff --git a/src/upnp/upnp_context.cpp b/src/upnp/upnp_context.cpp
index 0bbd282..cc54cb1 100644
--- a/src/upnp/upnp_context.cpp
+++ b/src/upnp/upnp_context.cpp
@@ -88,7 +88,7 @@
         proto->terminate();
     }
 
-    std::lock_guard<std::mutex> lock(mappingMutex_);
+    std::lock_guard lock(mappingMutex_);
     mappingList_->clear();
     mappingListUpdateTimer_.cancel();
     controllerList_.clear();
@@ -100,7 +100,7 @@
 void
 UPnPContext::shutdown()
 {
-    std::unique_lock<std::mutex> lk(mappingMutex_);
+    std::unique_lock lk(mappingMutex_);
     std::condition_variable cv;
 
     ctx->post([&, this] { shutdown(cv); });
@@ -173,7 +173,7 @@
     // list while holding the lock.
     std::list<Mapping::sharedPtr_t> toRemoveList;
     {
-        std::lock_guard<std::mutex> lock(mappingMutex_);
+        std::lock_guard lock(mappingMutex_);
 
         PortType types[2] {PortType::TCP, PortType::UDP};
         for (auto& type : types) {
@@ -302,7 +302,7 @@
     if (not addr)
         return;
 
-    std::lock_guard<std::mutex> lock(mappingMutex_);
+    std::lock_guard lock(mappingMutex_);
     if (knownPublicAddress_ != addr) {
         knownPublicAddress_ = std::move(addr);
         if (logger_) logger_->debug("Setting the known public address to {}", addr.toString());
@@ -312,14 +312,14 @@
 bool
 UPnPContext::isReady() const
 {
-    std::lock_guard<std::mutex> lock(mappingMutex_);
+    std::lock_guard lock(mappingMutex_);
     return not validIgdList_.empty();
 }
 
 IpAddr
 UPnPContext::getExternalIP() const
 {
-    std::lock_guard<std::mutex> lock(mappingMutex_);
+    std::lock_guard lock(mappingMutex_);
     // Return the first IGD Ip available.
     if (not validIgdList_.empty()) {
         return (*validIgdList_.begin())->getPublicIp();
@@ -342,7 +342,7 @@
     Mapping::sharedPtr_t mapRes;
 
     {
-        std::lock_guard<std::mutex> lock(mappingMutex_);
+        std::lock_guard lock(mappingMutex_);
         auto& mappingList = getMappingList(requestedMap.getType());
 
         // We try to provide a mapping in "OPEN" state. If not found,
@@ -417,7 +417,7 @@
 UPnPContext::registerController(void* controller)
 {
     {
-        std::lock_guard<std::mutex> lock(mappingMutex_);
+        std::lock_guard lock(mappingMutex_);
         if (shutdownComplete_) {
             if (logger_) logger_->warn("UPnPContext already shut down");
             return;
@@ -439,7 +439,7 @@
 {
     if (shutdownComplete_)
         return;
-    std::unique_lock<std::mutex> lock(mappingMutex_);
+    std::unique_lock lock(mappingMutex_);
     if (controllerList_.erase(controller) == 1) {
         if (logger_) logger_->debug("Successfully unregistered controller {}", fmt::ptr(controller));
     } else {
@@ -458,7 +458,7 @@
     // Only return an availalable random port. No actual
     // reservation is made here.
 
-    std::lock_guard<std::mutex> lock(mappingMutex_);
+    std::lock_guard lock(mappingMutex_);
     auto& mappingList = getMappingList(type);
     int tryCount = 0;
     while (tryCount++ < MAX_REQUEST_RETRIES) {
@@ -533,7 +533,7 @@
 
     //CHECK_VALID_THREAD();
 
-    std::lock_guard<std::mutex> lock(mappingMutex_);
+    std::lock_guard lock(mappingMutex_);
     auto& mappingList = getMappingList(type);
 
     for (auto it = mappingList.begin(); it != mappingList.end();) {
@@ -669,7 +669,7 @@
                 status.failedCount_);
 
         if (status.failedCount_ > 0) {
-            std::lock_guard<std::mutex> lock(mappingMutex_);
+            std::lock_guard lock(mappingMutex_);
             auto const& mappingList = getMappingList(type);
             for (auto const& [_, map] : mappingList) {
                 if (map->getState() == MappingState::FAILED) {
@@ -734,7 +734,7 @@
     auto remoteMapList = protocol->getMappingsListByDescr(igd,
                                                           Mapping::UPNP_MAPPING_DESCRIPTION_PREFIX);
     /*if (remoteMapList.empty()) {
-        std::lock_guard<std::mutex> lock(mappingMutex_);
+        std::lock_guard lock(mappingMutex_);
         if (not getMappingList(PortType::TCP).empty() or getMappingList(PortType::TCP).empty()) {
             // JAMI_WARN("We have provisionned mappings but the PUPNP IGD returned an empty list!");
         }
@@ -755,7 +755,7 @@
         // Use a temporary list to avoid processing mappings while holding the lock.
         std::list<Mapping::sharedPtr_t> toRemoveList;
         {
-            std::lock_guard<std::mutex> lock(mappingMutex_);
+            std::lock_guard lock(mappingMutex_);
             for (auto const& [_, map] : getMappingList(type)) {
                 // Only check mappings allocated by UPNP protocol.
                 if (map->getProtocol() != NatProtocolType::PUPNP) {
@@ -789,7 +789,7 @@
     // Use a temporary list to avoid processing mappings while holding the lock.
     std::list<Mapping> toRemoveList;
     {
-        std::lock_guard<std::mutex> lock(mappingMutex_);
+        std::lock_guard lock(mappingMutex_);
 
         for (auto const& [_, map] : remoteMapList) {
             // Must has valid IGD pointer and use UPNP protocol.
@@ -823,7 +823,7 @@
     // processing the mapping list.
     std::list<Mapping::sharedPtr_t> toRemoveList;
     {
-        std::lock_guard<std::mutex> lock(mappingMutex_);
+        std::lock_guard lock(mappingMutex_);
 
         PortType types[2] {PortType::TCP, PortType::UDP};
         for (auto& type : types) {
@@ -855,7 +855,7 @@
 
     // Populate the list of requests to perform.
     {
-        std::lock_guard<std::mutex> lock(mappingMutex_);
+        std::lock_guard lock(mappingMutex_);
         PortType typeArray[2] {PortType::TCP, PortType::UDP};
 
         for (auto type : typeArray) {
@@ -887,7 +887,7 @@
 
     // Populate the list of requests for mappings with auto-update enabled.
     {
-        std::lock_guard<std::mutex> lock(mappingMutex_);
+        std::lock_guard lock(mappingMutex_);
         PortType typeArray[2] {PortType::TCP, PortType::UDP};
 
         for (auto type : typeArray) {
@@ -971,14 +971,14 @@
 
         pruneMappingsWithInvalidIgds(igd);
 
-        std::lock_guard<std::mutex> lock(mappingMutex_);
+        std::lock_guard lock(mappingMutex_);
         validIgdList_.erase(igd);
         return;
     }
 
     // Update the IGD list.
     {
-        std::lock_guard<std::mutex> lock(mappingMutex_);
+        std::lock_guard lock(mappingMutex_);
         auto ret = validIgdList_.emplace(igd);
         if (ret.second) {
             if (logger_) logger_->debug("IGD [{}] on address {} was added. Will process any pending requests",
@@ -1072,7 +1072,7 @@
 void
 UPnPContext::deleteAllMappings(PortType type)
 {
-    std::lock_guard<std::mutex> lock(mappingMutex_);
+    std::lock_guard lock(mappingMutex_);
     auto& mappingList = getMappingList(type);
 
     for (auto const& [_, map] : mappingList) {
@@ -1108,7 +1108,7 @@
     Mapping::sharedPtr_t mapPtr;
 
     {
-        std::lock_guard<std::mutex> lock(mappingMutex_);
+        std::lock_guard lock(mappingMutex_);
         auto& mappingList = getMappingList(map.getType());
 
         auto ret = mappingList.emplace(map.getMapKey(), std::make_shared<Mapping>(map));
@@ -1167,7 +1167,7 @@
 Mapping::sharedPtr_t
 UPnPContext::getMappingWithKey(Mapping::key_t key)
 {
-    std::lock_guard<std::mutex> lock(mappingMutex_);
+    std::lock_guard lock(mappingMutex_);
     auto const& mappingList = getMappingList(Mapping::getTypeFromMapKey(key));
     auto it = mappingList.find(key);
     if (it == mappingList.end())
@@ -1178,7 +1178,7 @@
 void
 UPnPContext::getMappingStatus(PortType type, MappingStatus& status)
 {
-    std::lock_guard<std::mutex> lock(mappingMutex_);
+    std::lock_guard lock(mappingMutex_);
     auto& mappingList = getMappingList(type);
 
     for (auto const& [_, map] : mappingList) {
@@ -1278,7 +1278,7 @@
     std::vector<Mapping::sharedPtr_t> toRenew;
 
     for (auto type : {PortType::TCP, PortType::UDP}) {
-        std::lock_guard<std::mutex> lock(mappingMutex_);
+        std::lock_guard lock(mappingMutex_);
         auto mappingList = getMappingList(type);
         for (auto const& [_, map] : mappingList) {
             if (not map->isValid())