提交 baead3dd authored 作者: Moises Silva's avatar Moises Silva

freetdm: handle timer id wrap-around

上级 b3f9bfcb
......@@ -325,6 +325,13 @@ FT_DECLARE(ftdm_status_t) ftdm_sched_timer(ftdm_sched_t *sched, const char *name
}
newtimer->id = sched->currid;
sched->currid++;
if (!sched->currid) {
ftdm_log(FTDM_LOG_NOTICE, "Timer id wrap around for sched %s\n", sched->name);
/* we do not want currid to be zero since is an invalid id
* TODO: check that currid does not exists already in the context, it'd be insane
* though, having a timer to live all that time */
sched->currid++;
}
ftdm_set_string(newtimer->name, name);
newtimer->callback = callback;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论