]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/shared_cache.hpp: empty() iff weak_refs is empty
authorSamuel Just <sjust@redhat.com>
Wed, 14 Jan 2015 16:35:15 +0000 (08:35 -0800)
committerSamuel Just <sjust@redhat.com>
Thu, 15 Jan 2015 05:06:38 +0000 (21:06 -0800)
Also, add a comment to clarify usage.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/common/shared_cache.hpp

index c4e65e467cb80ac312c4b41210937ebc1d15776d..7bdf03ee24e35edc617b4c799d5beb0cfda7096d 100644 (file)
@@ -303,9 +303,15 @@ public:
     }
   }
 
+  /**
+   * empty()
+   *
+   * Returns true iff there are no live references left to anything that has been
+   * in the cache.
+   */
   bool empty() {
     Mutex::Locker l(lock);
-    return contents.empty();
+    return weak_refs.empty();
   }
 
   /***