Guest User

Untitled

a guest
Jan 24th, 2018
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. commit 955fdb039e7ac18322bc37e411c216702fb158a3
  2. Author: Sylvain Munaut <tnt@246tNt.com>
  3. Date: Mon Oct 17 23:03:57 2011 +0200
  4.  
  5. timer: Fix implementation of osmo_timers_nearest causing high CPU load
  6.  
  7. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
  8.  
  9. diff --git a/src/timer.c b/src/timer.c
  10. index 6852983..d1a4e7e 100644
  11. --- a/src/timer.c
  12. +++ b/src/timer.c
  13. @@ -132,12 +132,10 @@ int osmo_timer_pending(struct osmo_timer_list *timer)
  14. */
  15. struct timeval *osmo_timers_nearest(void)
  16. {
  17. - static struct timeval no_timers = { 0, 0 };
  18. -
  19. - if (nearest_p != NULL && !timerisset(nearest_p))
  20. + if (nearest_p != NULL)
  21. return nearest_p;
  22. else
  23. - return &no_timers;
  24. + return NULL;
  25. }
  26.  
  27. static void update_nearest(struct timeval *cand, struct timeval *current)
Add Comment
Please, Sign In to add comment