From: Sage Weil Date: Fri, 14 Sep 2018 15:52:40 +0000 (-0500) Subject: common/Mutex: typedef lock_guard Locker X-Git-Tag: v14.0.1~220^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ea9a72512d43bb33c6a357bbfc47a8e195cee145;p=ceph.git common/Mutex: typedef lock_guard Locker Signed-off-by: Sage Weil --- diff --git a/src/common/Mutex.h b/src/common/Mutex.h index 5e536c4898a73..e8d528848d0a8 100644 --- a/src/common/Mutex.h +++ b/src/common/Mutex.h @@ -20,6 +20,7 @@ #include #include +#include using namespace ceph; @@ -105,17 +106,7 @@ public: public: - class Locker { - Mutex &mutex; - - public: - explicit Locker(Mutex& m) : mutex(m) { - mutex.lock(); - } - ~Locker() { - mutex.unlock(); - } - }; + typedef std::lock_guard Locker; };