aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte (local) <laflocal@hanuman.gnumonks.org>2009-08-14 14:30:00 +0200
committerHarald Welte (local) <laflocal@hanuman.gnumonks.org>2009-08-14 14:30:00 +0200
commitfed176ab90fe51ba503e2b863fed48dff0b7c4e7 (patch)
tree8dd61b6cd885fa8ef1cf7907bd6b2d5deb013e1c /openbsc
parentdaef606502373b642776325a5989a283858b78d2 (diff)
implement a timer_list check before we return into the select() loop
this helps us to debug timer_list corruption
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/select.c2
-rw-r--r--openbsc/src/timer.c11
2 files changed, 13 insertions, 0 deletions
diff --git a/openbsc/src/select.c b/openbsc/src/select.c
index 7f45426d0..c11f3a511 100644
--- a/openbsc/src/select.c
+++ b/openbsc/src/select.c
@@ -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());
diff --git a/openbsc/src/timer.c b/openbsc/src/timer.c
index a942ffd6d..6f974a2c3 100644
--- a/openbsc/src/timer.c
+++ b/openbsc/src/timer.c
@@ -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;
+}