]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/sharedptr_registry.hpp: add remove
authorSamuel Just <sam.just@inktank.com>
Thu, 9 May 2013 23:29:28 +0000 (16:29 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 10 May 2013 00:28:15 +0000 (17:28 -0700)
remove() can be used to clear an entry before all of its
references are removed.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/common/sharedptr_registry.hpp

index e155015ef60674b86bb9752ce3ea8c98c412837d..8669d063a79fc5d875edf2b57e1ff766ae9c7d89 100644 (file)
@@ -100,6 +100,12 @@ public:
     return retval;
   }
 
+  void remove(const K &key) {
+    Mutex::Locker l(lock);
+    contents.erase(key);
+    cond.Signal();
+  }
+
   template<class A>
   VPtr lookup_or_create(const K &key, const A &arg) {
     Mutex::Locker l(lock);