From: Sage Weil Date: Tue, 16 Oct 2018 14:28:30 +0000 (-0500) Subject: common/lru_map: Mutex -> ceph::mutex X-Git-Tag: v14.1.0~820^2~30 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ea72b75088492a39e453d51ff19fd05ad3e86e1b;p=ceph.git common/lru_map: Mutex -> ceph::mutex Signed-off-by: Sage Weil --- diff --git a/src/common/lru_map.h b/src/common/lru_map.h index 3b0bb543f06d..4c1c2dadbf8c 100644 --- a/src/common/lru_map.h +++ b/src/common/lru_map.h @@ -1,7 +1,7 @@ #ifndef CEPH_LRU_MAP_H #define CEPH_LRU_MAP_H -#include "common/Mutex.h" +#include "common/ceph_mutex.h" template class lru_map { @@ -13,7 +13,7 @@ class lru_map { std::map entries; std::list entries_lru; - Mutex lock; + ceph::mutex lock = ceph::make_mutex("lru_map::lock"); size_t max; @@ -30,7 +30,7 @@ public: void _add(const K& key, V& value); public: - lru_map(int _max) : lock("lru_map"), max(_max) {} + lru_map(int _max) : max(_max) {} virtual ~lru_map() {} bool find(const K& key, V& value); @@ -74,14 +74,14 @@ bool lru_map::_find(const K& key, V *value, UpdateContext *ctx) template bool lru_map::find(const K& key, V& value) { - std::lock_guard l(lock); + std::lock_guard l(lock); return _find(key, &value, NULL); } template bool lru_map::find_and_update(const K& key, V *value, UpdateContext *ctx) { - std::lock_guard l(lock); + std::lock_guard l(lock); return _find(key, value, ctx); } @@ -112,14 +112,14 @@ void lru_map::_add(const K& key, V& value) template void lru_map::add(const K& key, V& value) { - std::lock_guard l(lock); + std::lock_guard l(lock); _add(key, value); } template void lru_map::erase(const K& key) { - std::lock_guard l(lock); + std::lock_guard l(lock); typename std::map::iterator iter = entries.find(key); if (iter == entries.end()) return;