diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index e708eee70e..fcd88ed8d7 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -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;