From: phk Date: Thu, 12 Jul 2007 09:25:07 +0000 (+0000) Subject: Replace ev_now() with TIM_mono(). X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b9fbc5f80e4d6a5dd69ac77102bb58fa2b59f13;p=varnish Replace ev_now() with TIM_mono(). git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1669 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/mgt_event.c b/varnish-cache/bin/varnishd/mgt_event.c index 12a65fd9..40fe6a1b 100644 --- a/varnish-cache/bin/varnishd/mgt_event.c +++ b/varnish-cache/bin/varnishd/mgt_event.c @@ -37,10 +37,6 @@ #include #include -#ifndef HAVE_CLOCK_GETTIME -#include "compat/clock_gettime.h" -#endif - #include "mgt.h" #include "mgt_event.h" #include "miniobj.h" @@ -76,19 +72,6 @@ struct evbase { /*--------------------------------------------------------------------*/ -static double -ev_now(void) -{ - double t; - struct timespec ts; - - assert(clock_gettime(CLOCK_MONOTONIC, &ts) == 0); - t = ts.tv_sec + ts.tv_nsec * 1e-9; - return (t); -} - -/*--------------------------------------------------------------------*/ - static void ev_bh_update(void *priv, void *a, unsigned u) { @@ -265,7 +248,7 @@ ev_add(struct evbase *evb, struct ev *e) e->magic = EV_MAGIC; /* before binheap_insert() */ if (e->timeout != 0.0) { - e->__when += ev_now() + e->timeout; + e->__when += TIM_mono() + e->timeout; binheap_insert(evb->binheap, e); assert(e->__binheap_idx > 0); } else { @@ -430,7 +413,7 @@ ev_schedule_one(struct evbase *evb) if (e != NULL) { CHECK_OBJ_NOTNULL(e, EV_MAGIC); assert(e->__binheap_idx == 1); - t = ev_now(); + t = TIM_mono(); if (e->__when <= t) return (ev_sched_timeout(evb, e, t)); tmo = (int)((e->__when - t) * 1e3); @@ -453,7 +436,7 @@ ev_schedule_one(struct evbase *evb) return (ev_sched_signal(evb)); if (i == 0) { assert(e != NULL); - t = ev_now(); + t = TIM_mono(); if (e->__when <= t) return (ev_sched_timeout(evb, e, t)); }