You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jd...@apache.org on 2019/04/10 20:37:19 UTC

[qpid-dispatch] branch master updated: DISPATCH-1270 - Use CLOCK_MONOTONIC for purpose of calling pn_transport_tick

This is an automated email from the ASF dual-hosted git repository.

jdanek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/master by this push:
     new 9bb0662  DISPATCH-1270 - Use CLOCK_MONOTONIC for purpose of calling pn_transport_tick
9bb0662 is described below

commit 9bb06620c63ab47441d2e4c68c81f66fe0aff050
Author: Jiri Danek <jd...@redhat.com>
AuthorDate: Sun Feb 24 17:23:59 2019 +0100

    DISPATCH-1270 - Use CLOCK_MONOTONIC for purpose of calling pn_transport_tick
---
 include/qpid/dispatch/timer.h | 2 +-
 src/http-libwebsockets.c      | 4 ++--
 src/timer.c                   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/qpid/dispatch/timer.h b/include/qpid/dispatch/timer.h
index d0592d3..d477011 100644
--- a/include/qpid/dispatch/timer.h
+++ b/include/qpid/dispatch/timer.h
@@ -33,7 +33,7 @@
  */
 
 typedef struct qd_timer_t qd_timer_t;
-/** Absolute time stamp, milliseconds since epoch */
+/** Absolute time stamp from monotonic clock source, milliseconds since arbitrary (fixed) instant */
 typedef int64_t qd_timestamp_t;
 /** Relative duration in milliseconds */
 typedef int64_t qd_duration_t;
diff --git a/src/http-libwebsockets.c b/src/http-libwebsockets.c
index db1c10b..f086dca 100644
--- a/src/http-libwebsockets.c
+++ b/src/http-libwebsockets.c
@@ -213,8 +213,8 @@ struct qd_http_server_t {
     work_queue_t work;
     qd_log_source_t *log;
     struct lws_context *context;
-    pn_timestamp_t now;         /* Cache current time in thread_run */
-    pn_timestamp_t next_tick;   /* Next requested tick service */
+    qd_timestamp_t now;         /* Cache current time in thread_run */
+    qd_timestamp_t next_tick;   /* Next requested tick service */
 };
 
 static void work_queue_destroy(work_queue_t *wq) {
diff --git a/src/timer.c b/src/timer.c
index a4aae2a..f0f5e2d 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -116,7 +116,7 @@ void qd_timer_free(qd_timer_t *timer)
 
 qd_timestamp_t qd_timer_now() {
     struct timespec tv;
-    clock_gettime(CLOCK_REALTIME, &tv);
+    clock_gettime(CLOCK_MONOTONIC, &tv);
     return ((qd_timestamp_t)tv.tv_sec) * 1000 + tv.tv_nsec / 1000000;
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org