[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.
This commit is contained in:
parent
15d6f34de7
commit
ba7acaa5bc
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue