diff --git a/src/inc/ttimer.h b/src/inc/ttimer.h index 9313bf3ec02cdc8a8f356f1317d6c6857c15d1a6..91e4ffa3dd8d23d5c4c5d842dd4c8822527ed014 100644 --- a/src/inc/ttimer.h +++ b/src/inc/ttimer.h @@ -29,8 +29,6 @@ void *taosTmrInit(int maxTmr, int resoultion, int longest, char *label); tmr_h taosTmrStart(void (*fp)(void *, void *), int mseconds, void *param1, void *handle); -void taosTmrStop(tmr_h tmrId); - void taosTmrStopA(tmr_h *timerId); void taosTmrReset(void (*fp)(void *, void *), int mseconds, void *param1, void *handle, tmr_h *pTmrId); diff --git a/src/util/src/ttimer.c b/src/util/src/ttimer.c index 65b1f857ad7d0e1ee321447902308051d8270516..a89dbaebe613b35664b1487a0aec16959f4091bd 100644 --- a/src/util/src/ttimer.c +++ b/src/util/src/ttimer.c @@ -368,44 +368,6 @@ tmr_h taosTmrStart(void (*fp)(void *, void *), int mseconds, void *param1, void return (tmr_h)pObj; } -void taosTmrStop(tmr_h timerId) { - tmr_obj_t * pObj; - tmr_list_t *pList; - tmr_ctrl_t *pCtrl; - - pObj = (tmr_obj_t *)timerId; - if (pObj == NULL) return; - - pCtrl = pObj->pCtrl; - if (pCtrl == NULL) return; - - if (pthread_mutex_lock(&pCtrl->mutex) != 0) - tmrError("%s mutex lock failed, reason:%s", pCtrl->label, strerror(errno)); - - if (pObj->timerId == timerId) { - pList = &(pCtrl->tmrList[pObj->index]); - if (pObj->prev) { - pObj->prev->next = pObj->next; - } else { - pList->head = pObj->next; - } - - if (pObj->next) { - pObj->next->prev = pObj->prev; - } - - pList->count--; - pObj->timerId = NULL; - pCtrl->numOfTmrs--; - - tmrTrace("%s %p, timer stopped, fp:%p, tmr_h:%p, total:%d", pCtrl->label, pObj->param1, pObj->fp, pObj, - pCtrl->numOfTmrs); - tmrMemPoolFree(pCtrl->poolHandle, (char *)(pObj)); - } - - pthread_mutex_unlock(&pCtrl->mutex); -} - void taosTmrStopA(tmr_h *timerId) { tmr_obj_t * pObj; tmr_list_t *pList;