From: Adam C. Emerson Date: Mon, 14 Mar 2016 17:43:31 +0000 (-0400) Subject: time: Properly expose coarse clocks and timepoints X-Git-Tag: v11.0.0~824^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=60c9bd19c5b7e4b090a2928c56cb56c3a35953a3;p=ceph.git time: Properly expose coarse clocks and timepoints Fix a typo and add a missing typedef. Signed-off-by: Adam C. Emerson --- diff --git a/src/common/ceph_time.cc b/src/common/ceph_time.cc index 886016552c5..e93dcd97206 100644 --- a/src/common/ceph_time.cc +++ b/src/common/ceph_time.cc @@ -62,7 +62,7 @@ namespace ceph { to_ceph_timespec(t, ts); return ts; } - real_clock::time_point coarse_real_clock::from_ceph_timespec( + coarse_real_clock::time_point coarse_real_clock::from_ceph_timespec( const struct ceph_timespec& ts) { return time_point(seconds(ts.tv_sec) + nanoseconds(ts.tv_nsec)); } diff --git a/src/common/ceph_time.h b/src/common/ceph_time.h index ef187c0a83f..6a398fa2439 100644 --- a/src/common/ceph_time.h +++ b/src/common/ceph_time.h @@ -150,7 +150,7 @@ namespace ceph { typedef duration::period period; // The second template parameter defaults to the clock's duration // type. - typedef std::chrono::time_point time_point; + typedef std::chrono::time_point time_point; static constexpr const bool is_steady = false; static time_point now() noexcept { @@ -243,7 +243,7 @@ namespace ceph { typedef timespan duration; typedef duration::rep rep; typedef duration::period period; - typedef std::chrono::time_point time_point; + typedef std::chrono::time_point time_point; static constexpr const bool is_steady = true; static time_point now() noexcept { @@ -306,12 +306,14 @@ namespace ceph { // Actual wall-clock times typedef real_clock::time_point real_time; + typedef coarse_real_clock::time_point coarse_real_time; // Monotonic times should never be serialized or communicated // between machines, since they are incomparable. Thus we also don't // make any provision for converting between // std::chrono::steady_clock time and ceph::mono_clock time. typedef mono_clock::time_point mono_time; + typedef coarse_mono_clock::time_point coarse_mono_time; template auto floor(const std::chrono::duration& duration, @@ -363,6 +365,8 @@ namespace ceph { std::ostream& operator<<(std::ostream& m, const timespan& t); std::ostream& operator<<(std::ostream& m, const real_time& t); std::ostream& operator<<(std::ostream& m, const mono_time& t); + + // To gain sane behavior with signs } // namespace ceph // We need these definitions to be able to hande ::encode/::decode on