From 82ea4c2fc2e6c4c78d8bb6d6e11e94466a63fe61 Mon Sep 17 00:00:00 2001 From: Bomin Zhang Date: Mon, 22 Jun 2020 16:52:43 +0800 Subject: [PATCH] fix coverity 291725 --- src/util/src/ttimer.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/util/src/ttimer.c b/src/util/src/ttimer.c index f7acc1132d..a19b3607fd 100644 --- a/src/util/src/ttimer.c +++ b/src/util/src/ttimer.c @@ -385,8 +385,8 @@ static void taosTimerLoopFunc(int signo) { timer = next; } - pthread_mutex_unlock(&wheel->mutex); wheel->nextScanAt += wheel->resolution; + pthread_mutex_unlock(&wheel->mutex); } addToExpired(expired); @@ -514,17 +514,14 @@ static void taosTmrModuleInit(void) { tmrError("failed to create the mutex for wheel, reason:%s", strerror(errno)); return; } - pthread_mutex_lock(&wheel->mutex); wheel->nextScanAt = now + wheel->resolution; wheel->index = 0; wheel->slots = (tmr_obj_t**)calloc(wheel->size, sizeof(tmr_obj_t*)); if (wheel->slots == NULL) { tmrError("failed to allocate wheel slots"); - pthread_mutex_unlock(&wheel->mutex); return; } timerMap.size += wheel->size; - pthread_mutex_unlock(&wheel->mutex); } timerMap.count = 0;