fix coverity 291725
This commit is contained in:
parent
0c5054a311
commit
82ea4c2fc2
|
@ -385,8 +385,8 @@ static void taosTimerLoopFunc(int signo) {
|
||||||
|
|
||||||
timer = next;
|
timer = next;
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&wheel->mutex);
|
|
||||||
wheel->nextScanAt += wheel->resolution;
|
wheel->nextScanAt += wheel->resolution;
|
||||||
|
pthread_mutex_unlock(&wheel->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
addToExpired(expired);
|
addToExpired(expired);
|
||||||
|
@ -514,17 +514,14 @@ static void taosTmrModuleInit(void) {
|
||||||
tmrError("failed to create the mutex for wheel, reason:%s", strerror(errno));
|
tmrError("failed to create the mutex for wheel, reason:%s", strerror(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pthread_mutex_lock(&wheel->mutex);
|
|
||||||
wheel->nextScanAt = now + wheel->resolution;
|
wheel->nextScanAt = now + wheel->resolution;
|
||||||
wheel->index = 0;
|
wheel->index = 0;
|
||||||
wheel->slots = (tmr_obj_t**)calloc(wheel->size, sizeof(tmr_obj_t*));
|
wheel->slots = (tmr_obj_t**)calloc(wheel->size, sizeof(tmr_obj_t*));
|
||||||
if (wheel->slots == NULL) {
|
if (wheel->slots == NULL) {
|
||||||
tmrError("failed to allocate wheel slots");
|
tmrError("failed to allocate wheel slots");
|
||||||
pthread_mutex_unlock(&wheel->mutex);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
timerMap.size += wheel->size;
|
timerMap.size += wheel->size;
|
||||||
pthread_mutex_unlock(&wheel->mutex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
timerMap.count = 0;
|
timerMap.count = 0;
|
||||||
|
|
Loading…
Reference in New Issue