From e39f9785a3a759f4de61f4c19b91a065c8752349 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 31 Jul 2019 16:58:56 +0800 Subject: [PATCH] delete unused taosTmrStop --- src/inc/ttimer.h | 2 -- src/util/src/ttimer.c | 38 -------------------------------------- 2 files changed, 40 deletions(-) diff --git a/src/inc/ttimer.h b/src/inc/ttimer.h index 9313bf3ec0..91e4ffa3dd 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 65b1f857ad..a89dbaebe6 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; -- GitLab