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

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


The following commit(s) were added to refs/heads/main by this push:
     new b1c25e9  DISPATCH-2077 Replace `clock_gettime` in `qd_timer_now` with 
`pn_proactor_now_64` from Proton (#1297)
b1c25e9 is described below

commit b1c25e94c76926c35ee48ced4053abfc23fdf347
Author: Jiri Daněk <jda...@redhat.com>
AuthorDate: Thu Jul 15 08:57:53 2021 +0200

    DISPATCH-2077 Replace `clock_gettime` in `qd_timer_now` with 
`pn_proactor_now_64` from Proton (#1297)
---
 src/timer.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/timer.c b/src/timer.c
index c87e0f2..441bbad 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -27,9 +27,10 @@
 #include "qpid/dispatch/ctools.h"
 #include "qpid/dispatch/atomic.h"
 
+#include <proton/proactor.h>
+
 #include <assert.h>
 #include <stdio.h>
-#include <time.h>
 
 
 // timer state machine
@@ -205,9 +206,7 @@ void qd_timer_free(qd_timer_t *timer)
 __attribute__((weak)) // permit replacement by dummy implementation in 
unit_tests
 qd_timestamp_t qd_timer_now()
 {
-    struct timespec tv;
-    clock_gettime(CLOCK_MONOTONIC, &tv);
-    return ((qd_timestamp_t)tv.tv_sec) * 1000 + tv.tv_nsec / 1000000;
+    return pn_proactor_now_64();
 }
 
 void qd_timer_schedule(qd_timer_t *timer, qd_duration_t duration)

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

Reply via email to