Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit 955fdb039e7ac18322bc37e411c216702fb158a3
- Author: Sylvain Munaut <tnt@246tNt.com>
- Date: Mon Oct 17 23:03:57 2011 +0200
- timer: Fix implementation of osmo_timers_nearest causing high CPU load
- Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
- diff --git a/src/timer.c b/src/timer.c
- index 6852983..d1a4e7e 100644
- --- a/src/timer.c
- +++ b/src/timer.c
- @@ -132,12 +132,10 @@ int osmo_timer_pending(struct osmo_timer_list *timer)
- */
- struct timeval *osmo_timers_nearest(void)
- {
- - static struct timeval no_timers = { 0, 0 };
- -
- - if (nearest_p != NULL && !timerisset(nearest_p))
- + if (nearest_p != NULL)
- return nearest_p;
- else
- - return &no_timers;
- + return NULL;
- }
- static void update_nearest(struct timeval *cand, struct timeval *current)
Add Comment
Please, Sign In to add comment