Merge pull request #29646 from taosdata/fix/TD-33600
fix:[TD-33600] windows error if taos exist without connection
This commit is contained in:
commit
6a597b3d89
|
@ -1601,6 +1601,11 @@ void tmqFreeImpl(void* handle) {
|
|||
|
||||
static void tmqMgmtInit(void) {
|
||||
tmqInitRes = 0;
|
||||
|
||||
if (taosThreadMutexInit(&tmqMgmt.lock, NULL) != 0){
|
||||
goto END;
|
||||
}
|
||||
|
||||
tmqMgmt.timer = taosTmrInit(1000, 100, 360000, "TMQ");
|
||||
|
||||
if (tmqMgmt.timer == NULL) {
|
||||
|
@ -1612,10 +1617,6 @@ static void tmqMgmtInit(void) {
|
|||
goto END;
|
||||
}
|
||||
|
||||
if (taosThreadMutexInit(&tmqMgmt.lock, NULL) != 0){
|
||||
goto END;
|
||||
}
|
||||
|
||||
return;
|
||||
END:
|
||||
tmqInitRes = terrno;
|
||||
|
@ -1627,8 +1628,8 @@ void tmqMgmtClose(void) {
|
|||
tmqMgmt.timer = NULL;
|
||||
}
|
||||
|
||||
if (tmqMgmt.rsetId > 0) {
|
||||
(void) taosThreadMutexLock(&tmqMgmt.lock);
|
||||
if (tmqMgmt.rsetId >= 0) {
|
||||
tmq_t *tmq = taosIterateRef(tmqMgmt.rsetId, 0);
|
||||
int64_t refId = 0;
|
||||
|
||||
|
@ -1647,9 +1648,9 @@ void tmqMgmtClose(void) {
|
|||
}
|
||||
taosCloseRef(tmqMgmt.rsetId);
|
||||
tmqMgmt.rsetId = -1;
|
||||
}
|
||||
(void)taosThreadMutexUnlock(&tmqMgmt.lock);
|
||||
}
|
||||
}
|
||||
|
||||
tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) {
|
||||
int32_t code = 0;
|
||||
|
|
Loading…
Reference in New Issue