提交 92b7a214 编写于 作者: wafwerar's avatar wafwerar

[TD-6169]<fix>: windows dll client can not quit.

上级 a44075c2
...@@ -199,7 +199,9 @@ void taos_init_imp(void) { ...@@ -199,7 +199,9 @@ void taos_init_imp(void) {
// In the APIs of other program language, taos_cleanup is not available yet. // In the APIs of other program language, taos_cleanup is not available yet.
// So, to make sure taos_cleanup will be invoked to clean up the allocated resource to suppress the valgrind warning. // So, to make sure taos_cleanup will be invoked to clean up the allocated resource to suppress the valgrind warning.
#if !defined(TD_WINDOWS)
atexit(taos_cleanup); atexit(taos_cleanup);
#endif
tscDebug("client is initialized successfully"); tscDebug("client is initialized successfully");
} }
......
...@@ -538,8 +538,8 @@ void taosCacheCleanup(SCacheObj *pCacheObj) { ...@@ -538,8 +538,8 @@ void taosCacheCleanup(SCacheObj *pCacheObj) {
// wait for the refresh thread quit before destroying the cache object. // wait for the refresh thread quit before destroying the cache object.
// But in the dll, the child thread will be killed before atexit takes effect.So here we only wait for one second. // But in the dll, the child thread will be killed before atexit takes effect.So here we only wait for one second.
// while(atomic_load_8(&pCacheObj->deleting)) { while(atomic_load_8(&pCacheObj->deleting)) {
for (int i = 0; i < 60&&atomic_load_8(&pCacheObj->deleting) != 0; i++) { // for (int i = 0; i < 60&&atomic_load_8(&pCacheObj->deleting) != 0; i++) {
taosMsleep(50); taosMsleep(50);
} }
...@@ -721,6 +721,8 @@ void* taosCacheTimedRefresh(void *handle) { ...@@ -721,6 +721,8 @@ void* taosCacheTimedRefresh(void *handle) {
continue; continue;
} }
pthread_mutex_unlock(&guard);
if ((count % pCacheObj->checkTick) != 0) { if ((count % pCacheObj->checkTick) != 0) {
continue; continue;
} }
...@@ -740,8 +742,6 @@ void* taosCacheTimedRefresh(void *handle) { ...@@ -740,8 +742,6 @@ void* taosCacheTimedRefresh(void *handle) {
} }
taosTrashcanEmpty(pCacheObj, false); taosTrashcanEmpty(pCacheObj, false);
pthread_mutex_unlock(&guard);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册