diff options
author | Joakim Tjernlund <Joakim.Tjernlund@transmode.se> | 2008-11-10 09:33:30 +0100 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2008-11-29 18:04:22 +0000 |
commit | b8192765a320f389e09bf7261e8902958ad21584 (patch) | |
tree | dab031e7db5d0f844164b52391155af17a3c2a81 /lib | |
parent | 6e907dd4abdff9c52c809ea49c76d789b11c0e12 (diff) |
[lib] Fix timer precision.
Whenever a thread adds an timer funcname_thread_add_timer_timeval() gets called
to add the timer. Before adding the timer a quagga_gettimeofday() call
is made to do some time house keeping. However quagga_gettimeofday() only
updates recent_time, not relative_time that is used to calculate
the alarm_time. Replace with quagga_get_relative (NULL)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/thread.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/thread.c b/lib/thread.c index 260e8c8e..948bc210 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -659,7 +659,7 @@ funcname_thread_add_timer_timeval (struct thread_master *m, thread = thread_get (m, type, func, arg, funcname); /* Do we need jitter here? */ - quagga_gettimeofday (&recent_time); + quagga_get_relative (NULL); alarm_time.tv_sec = relative_time.tv_sec + time_relative->tv_sec; alarm_time.tv_usec = relative_time.tv_usec + time_relative->tv_usec; thread->u.sands = timeval_adjust(alarm_time); |