From ea9a72512d43bb33c6a357bbfc47a8e195cee145 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 14 Sep 2018 10:52:40 -0500 Subject: [PATCH] common/Mutex: typedef lock_guard Locker Signed-off-by: Sage Weil --- src/common/Mutex.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) 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; }; -- 2.39.5