From 3d5818ec38c464b24f382d88c70b10df6c04b160 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Mon, 31 Aug 2009 15:13:48 +0200 Subject: use monotonic time source in convar->timed_wait, and in the scheduler using it --- src/charon/processing/scheduler.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/charon/processing/scheduler.c') diff --git a/src/charon/processing/scheduler.c b/src/charon/processing/scheduler.c index 1f59205af..f53ccb99a 100644 --- a/src/charon/processing/scheduler.c +++ b/src/charon/processing/scheduler.c @@ -190,7 +190,7 @@ static job_requeue_t schedule(private_scheduler_t * this) this->mutex->lock(this->mutex); - gettimeofday(&now, NULL); + time_monotonic(&now); if ((event = peek_event(this)) != NULL) { @@ -290,7 +290,7 @@ static void schedule_job(private_scheduler_t *this, job_t *job, u_int32_t s) { timeval_t tv; - gettimeofday(&tv, NULL); + time_monotonic(&tv); tv.tv_sec += s; schedule_job_tv(this, job, tv); @@ -303,7 +303,7 @@ static void schedule_job_ms(private_scheduler_t *this, job_t *job, u_int32_t ms) { timeval_t tv, add; - gettimeofday(&tv, NULL); + time_monotonic(&tv); add.tv_sec = ms / 1000; add.tv_usec = (ms % 1000) * 1000; -- cgit v1.2.3