From: Shen-Ta Hsieh(BestSteve) Date: Thu, 15 Mar 2018 12:31:13 +0000 (+0800) Subject: memstore: fix wrong use of lock_guard X-Git-Tag: v13.1.0~540^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dbc240fff215ac2074a9b6567956be2933d11b51;p=ceph.git memstore: fix wrong use of lock_guard std::lock_guard need a name to make RAII works properly Signed-off-by: Shen-Ta Hsieh --- diff --git a/src/os/memstore/MemStore.cc b/src/os/memstore/MemStore.cc index 47ec85d296fa..8dc41a95f205 100644 --- a/src/os/memstore/MemStore.cc +++ b/src/os/memstore/MemStore.cc @@ -566,35 +566,35 @@ public: : c(c), o(o), it(o->omap.begin()) {} int seek_to_first() override { - std::lock_guard(o->omap_mutex); + std::lock_guard lock(o->omap_mutex); it = o->omap.begin(); return 0; } int upper_bound(const string &after) override { - std::lock_guard(o->omap_mutex); + std::lock_guard lock(o->omap_mutex); it = o->omap.upper_bound(after); return 0; } int lower_bound(const string &to) override { - std::lock_guard(o->omap_mutex); + std::lock_guard lock(o->omap_mutex); it = o->omap.lower_bound(to); return 0; } bool valid() override { - std::lock_guard(o->omap_mutex); + std::lock_guard lock(o->omap_mutex); return it != o->omap.end(); } int next(bool validate=true) override { - std::lock_guard(o->omap_mutex); + std::lock_guard lock(o->omap_mutex); ++it; return 0; } string key() override { - std::lock_guard(o->omap_mutex); + std::lock_guard lock(o->omap_mutex); return it->first; } bufferlist value() override { - std::lock_guard(o->omap_mutex); + std::lock_guard lock(o->omap_mutex); return it->second; } int status() override {