From: Samuel Just Date: Wed, 14 Jan 2015 16:35:15 +0000 (-0800) Subject: common/shared_cache.hpp: empty() iff weak_refs is empty X-Git-Tag: v0.93~163^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=33ba23f06b469e19d0d859250892530c53d5abf6;p=ceph.git common/shared_cache.hpp: empty() iff weak_refs is empty Also, add a comment to clarify usage. Signed-off-by: Samuel Just --- diff --git a/src/common/shared_cache.hpp b/src/common/shared_cache.hpp index c4e65e467cb8..7bdf03ee24e3 100644 --- a/src/common/shared_cache.hpp +++ b/src/common/shared_cache.hpp @@ -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(); } /***