未验证 提交 a63daaf7 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #2883 from taosdata/feature/td-1033

td-1033: fix high cpu usage
......@@ -235,7 +235,9 @@ static void* telemetryThread(void* param) {
}
int startAt = taosGetTimestampSec();
struct timespec timeout = {.tv_sec = timeToWait, .tv_nsec = 0};
struct timespec timeout = {.tv_sec = 0, .tv_nsec = 0};
clock_gettime(CLOCK_REALTIME, &timeout);
timeout.tv_sec += timeToWait;
if (sem_timedwait(&tsExitSem, &timeout) == 0) {
break;
}
......@@ -279,4 +281,4 @@ void dnodeCleanupTelemetry() {
pthread_join(tsTelemetryThread, NULL);
sem_destroy(&tsExitSem);
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册