]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: drop the unused mutable_item_history container. 32698/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 17 Jan 2020 14:25:27 +0000 (15:25 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 17 Jan 2020 16:33:01 +0000 (17:33 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/common/item_history.h

index bf0b504c546fa90953cdc726734ea6b484e70390..87512a28c52e6939fdf09a1ad9df1b7fe8520d45 100644 (file)
@@ -15,44 +15,6 @@ total lifetime.
 
 */
 
-template<class T>
-class mutable_item_history {
-private:
-  std::mutex lock;
-  std::list<T> history;
-  T *current = nullptr;
-
-public:
-  mutable_item_history() {
-    history.emplace_back(T());
-    current = &history.back();
-  }
-
-  // readers are lock-free
-  const T& operator*() const {
-    return *current;
-  }
-  const T *operator->() const {
-    return current;
-  }
-
-  // non-const variants (be careful!)
-  T& operator*() {
-    return *current;
-  }
-  T *operator->() {
-    return current;
-  }
-
-  // writes are serialized
-  const T& operator=(const T& other) {
-    std::lock_guard l(lock);
-    history.push_back(other);
-    current = &history.back();
-    return *current;
-  }
-};
-
 template<class T>
 class safe_item_history {
 private: