]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objector: use std::shared_mutex instead of boost::shared_mutex 21702/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Fri, 27 Apr 2018 08:40:59 +0000 (10:40 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Fri, 27 Apr 2018 16:05:13 +0000 (18:05 +0200)
Since boost::threads support interruption by default locking over
boost::shared_mutexes may throw if the thread is interrupted. Replacing this by
std:: variant

Fixes: http://tracker.ceph.com/issues/23910
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/osdc/Objecter.h

index 64f3d329cf879fc8aaa3faf60a19406af1fdddf5..20c7825f9dc3d378f7a3854b79ef06531ecb414e 100644 (file)
@@ -1243,7 +1243,7 @@ private:
   version_t last_seen_osdmap_version;
   version_t last_seen_pgmap_version;
 
-  mutable boost::shared_mutex rwlock;
+  mutable std::shared_mutex rwlock;
   using lock_guard = std::lock_guard<decltype(rwlock)>;
   using unique_lock = std::unique_lock<decltype(rwlock)>;
   using shared_lock = boost::shared_lock<decltype(rwlock)>;
@@ -1692,7 +1692,7 @@ public:
     bool is_watch;
     ceph::coarse_mono_time watch_valid_thru; ///< send time for last acked ping
     int last_error;  ///< error from last failed ping|reconnect, if any
-    boost::shared_mutex watch_lock;
+    std::shared_mutex watch_lock;
     using lock_guard = std::unique_lock<decltype(watch_lock)>;
     using unique_lock = std::unique_lock<decltype(watch_lock)>;
     using shared_lock = boost::shared_lock<decltype(watch_lock)>;
@@ -1827,7 +1827,7 @@ public:
   };
 
   struct OSDSession : public RefCountedObject {
-    boost::shared_mutex lock;
+    std::shared_mutex lock;
     using lock_guard = std::lock_guard<decltype(lock)>;
     using unique_lock = std::unique_lock<decltype(lock)>;
     using shared_lock = boost::shared_lock<decltype(lock)>;