]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/config_proxy: Mutex -> ceph::mutex
authorSage Weil <sage@redhat.com>
Fri, 19 Oct 2018 13:42:09 +0000 (08:42 -0500)
committerKefu Chai <kchai@redhat.com>
Wed, 21 Nov 2018 03:56:33 +0000 (11:56 +0800)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config_proxy.h

index f3dc8d664c6fc54e378eac142d3adef3ee1e92b4..70e373f13ba09a22a76e16ad6d3af036bac7023d 100644 (file)
@@ -6,14 +6,14 @@
 #include "common/config.h"
 #include "common/config_obs.h"
 #include "common/config_obs_mgr.h"
-#include "common/Mutex.h"
+#include "common/ceph_mutex.h"
 
 // @c ConfigProxy is a facade of multiple config related classes. it exposes
 // the legacy settings with arrow operator, and the new-style config with its
 // member methods.
 class ConfigProxy {
   static ConfigValues get_config_values(const ConfigProxy &config_proxy) {
-    Mutex::Locker locker(config_proxy.lock);
+    std::lock_guard locker(config_proxy.lock);
     return config_proxy.values;
   }
 
@@ -28,17 +28,16 @@ class ConfigProxy {
    * recursive, for simplicity.
    * It is best if this lock comes first in the lock hierarchy. We will
    * hold this lock when calling configuration observers.  */
-  mutable Mutex lock;
+  mutable ceph::recursive_mutex lock =
+    ceph::make_recursive_mutex("ConfigProxy::lock");
 
 public:
   explicit ConfigProxy(bool is_daemon)
-    : config{values, obs_mgr, is_daemon},
-      lock{"ConfigProxy", true, false}
+    : config{values, obs_mgr, is_daemon}
   {}
   explicit ConfigProxy(const ConfigProxy &config_proxy)
     : values(get_config_values(config_proxy)),
-      config{values, obs_mgr, config_proxy.config.is_daemon},
-      lock{"ConfigProxy", true, false}
+      config{values, obs_mgr, config_proxy.config.is_daemon}
   {}
   const ConfigValues* operator->() const noexcept {
     return &values;