提交 ba7acaa5 编写于 作者: Y yifan hao

[Timer] Initialize the last tmrCtrls.

While initialize timer module, tmrCtrls is constructed to be a free
list. However, the last tmrCtrls is never initialized, which is
allocated from malloc(). Since the code relies on tmrCtrls->next
to tell if there's any free tmrCtrls left, the last tmrCtrls should
be properly linked to NULL.
上级 15d6f34d
......@@ -501,6 +501,7 @@ static void taosTmrModuleInit(void) {
tmr_ctrl_t* ctrl = tmrCtrls + i;
ctrl->next = ctrl + 1;
}
(tmrCtrls + taosMaxTmrCtrl - 1)->next = NULL;
unusedTmrCtrl = tmrCtrls;
pthread_mutex_init(&tmrCtrlMutex, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册