提交 28bff830 编写于 作者: D dapan1121

fix: log thread quit issue

上级 9551a269
...@@ -201,6 +201,11 @@ static void taosStopLog() { ...@@ -201,6 +201,11 @@ static void taosStopLog() {
void taosCloseLog() { void taosCloseLog() {
taosStopLog(); taosStopLog();
if (tsLogObj.logHandle != NULL && taosCheckPthreadValid(tsLogObj.logHandle->asyncThread)) {
taosThreadJoin(tsLogObj.logHandle->asyncThread, NULL);
taosThreadClear(&tsLogObj.logHandle->asyncThread);
}
if (tsLogObj.slowHandle != NULL) { if (tsLogObj.slowHandle != NULL) {
taosThreadMutexDestroy(&tsLogObj.slowHandle->buffMutex); taosThreadMutexDestroy(&tsLogObj.slowHandle->buffMutex);
taosCloseFile(&tsLogObj.slowHandle->pFile); taosCloseFile(&tsLogObj.slowHandle->pFile);
...@@ -209,10 +214,6 @@ void taosCloseLog() { ...@@ -209,10 +214,6 @@ void taosCloseLog() {
} }
if (tsLogObj.logHandle != NULL) { if (tsLogObj.logHandle != NULL) {
if (tsLogObj.logHandle != NULL && taosCheckPthreadValid(tsLogObj.logHandle->asyncThread)) {
taosThreadJoin(tsLogObj.logHandle->asyncThread, NULL);
taosThreadClear(&tsLogObj.logHandle->asyncThread);
}
tsLogInited = 0; tsLogInited = 0;
taosThreadMutexDestroy(&tsLogObj.logHandle->buffMutex); taosThreadMutexDestroy(&tsLogObj.logHandle->buffMutex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册