提交 c823ad91 编写于 作者: A Alex Duan

fix: build error

上级 8e28a63a
...@@ -741,38 +741,6 @@ void putBackAutoPtr(int type, STire* tire) { ...@@ -741,38 +741,6 @@ void putBackAutoPtr(int type, STire* tire) {
// ------------------- var Word -------------------------- // ------------------- var Word --------------------------
// //
// return true is need update value by async
bool updateTireValue(int type, bool autoFill) {
// TYPE CONTEXT GET FROM DB
taosThreadMutexLock(&tiresMutex);
// check need obtain from server
if (tires[type] == NULL) {
waitAutoFill = autoFill;
// need async obtain var names from db sever
if (threads[type] != NULL) {
if (taosThreadRunning(threads[type])) {
// thread running , need not obtain again, return
taosThreadMutexUnlock(&tiresMutex);
return NULL;
}
// destroy previous thread handle for new create thread handle
taosDestroyThread(threads[type]);
threads[type] = NULL;
}
// create new
void* param = taosMemoryMalloc(sizeof(int));
*((int*)param) = type;
threads[type] = taosCreateThread(varObtainThread, param);
taosThreadMutexUnlock(&tiresMutex);
return true;
}
taosThreadMutexUnlock(&tiresMutex);
return false;
}
#define MAX_CACHED_CNT 100000 // max cached rows 10w #define MAX_CACHED_CNT 100000 // max cached rows 10w
// write sql result to var name, return write rows cnt // write sql result to var name, return write rows cnt
int writeVarNames(int type, TAOS_RES* tres) { int writeVarNames(int type, TAOS_RES* tres) {
...@@ -849,6 +817,38 @@ void* varObtainThread(void* param) { ...@@ -849,6 +817,38 @@ void* varObtainThread(void* param) {
return NULL; return NULL;
} }
// return true is need update value by async
bool updateTireValue(int type, bool autoFill) {
// TYPE CONTEXT GET FROM DB
taosThreadMutexLock(&tiresMutex);
// check need obtain from server
if (tires[type] == NULL) {
waitAutoFill = autoFill;
// need async obtain var names from db sever
if (threads[type] != NULL) {
if (taosThreadRunning(threads[type])) {
// thread running , need not obtain again, return
taosThreadMutexUnlock(&tiresMutex);
return NULL;
}
// destroy previous thread handle for new create thread handle
taosDestroyThread(threads[type]);
threads[type] = NULL;
}
// create new
void* param = taosMemoryMalloc(sizeof(int));
*((int*)param) = type;
threads[type] = taosCreateThread(varObtainThread, param);
taosThreadMutexUnlock(&tiresMutex);
return true;
}
taosThreadMutexUnlock(&tiresMutex);
return false;
}
// only match next one word from all match words, return valuue must free by caller // only match next one word from all match words, return valuue must free by caller
char* matchNextPrefix(STire* tire, char* pre) { char* matchNextPrefix(STire* tire, char* pre) {
SMatch* match = NULL; SMatch* match = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册