don't add timer twice

This commit is contained in:
matthias.ringwald@gmail.com 2014-01-31 16:12:25 +00:00
parent 101aeb7e9c
commit e84cf9a425

View File

@ -101,6 +101,11 @@ static void embedded_add_timer(timer_source_t *ts){
#ifdef HAVE_TICK
linked_item_t *it;
for (it = (linked_item_t *) &timers; it->next ; it = it->next){
// don't add timer that's already in there
if ((timer_source_t *) it->next == ts){
log_error( "run_loop_timer_add error: timer to add already in list!\n");
return;
}
if (ts->timeout < ((timer_source_t *) it->next)->timeout) {
break;
}