]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/ceph_time: add real_clock::is_zero()
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 3 Mar 2016 06:25:15 +0000 (22:25 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 15 Mar 2016 01:52:23 +0000 (18:52 -0700)
to check whether time is not zero

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/common/ceph_time.h

index f0e188f97da4d92ba1ee94fc2010b756986b7943..ef187c0a83f4b6dac90a27a6d8d57bd1d95be853 100644 (file)
@@ -75,6 +75,10 @@ namespace ceph {
       // introducing configurable clock skew.
       static time_point now(const CephContext* cct) noexcept;
 
+      static bool is_zero(const time_point& t) {
+        return (t == time_point::min());
+      }
+
       // Allow conversion to/from any clock with the same interface as
       // std::chrono::system_clock)
       template<typename Clock, typename Duration>