]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: Do not use unique_lock, if manual lock/unlock are not necessary 19770/head
authorShinobu Kinjo <shinobu@redhat.com>
Thu, 4 Jan 2018 01:38:23 +0000 (10:38 +0900)
committerShinobu Kinjo <shinobu@redhat.com>
Thu, 4 Jan 2018 01:38:23 +0000 (10:38 +0900)
Signed-off-by: Shinobu Kinjo <shinobu@redhat.com>
src/common/mempool.cc

index 02ed3c6558e97d5e14015066a1dc59406f3fd237..a05d72a4b3045a7946ea69368f8e3f908a143008 100644 (file)
@@ -100,7 +100,7 @@ void mempool::pool_t::get_stats(
     total->bytes += shard[i].bytes;
   }
   if (debug_mode) {
-    std::unique_lock<std::mutex> shard_lock(lock);
+    std::lock_guard<std::mutex> shard_lock(lock);
     for (auto &p : type_map) {
       std::string n = ceph_demangle(p.second.type_name);
       stats_t &s = (*by_type)[n];