implement a timer_list check before we return into the select() loop

this helps us to debug timer_list corruption
This commit is contained in:
Harald Welte (local) 2009-08-14 14:30:00 +02:00
parent daef606502
commit fed176ab90
2 changed files with 13 additions and 0 deletions

View File

@ -78,6 +78,8 @@ int bsc_select_main(int polling)
FD_SET(ufd->fd, &exceptset);
}
bsc_timer_check();
if (!polling)
bsc_prepare_timers();
rc = select(maxfd+1, &readset, &writeset, &exceptset, polling ? &no_time : bsc_nearest_timer());

View File

@ -172,3 +172,14 @@ restart:
return work;
}
int bsc_timer_check(void)
{
struct timer_list *timer;
int i;
llist_for_each_entry(timer, &timer_list, entry) {
i++;
}
return i;
}