mirror of https://gerrit.osmocom.org/libosmocore
timer: Fix implementation of osmo_timers_nearest causing high CPU load
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
parent
16df917131
commit
955fdb039e
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue