From 3d9ddfa2b41e0964de54357516162bb0b7b19b80 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Fri, 7 Jun 2024 14:48:39 +0800 Subject: [PATCH] fix: add thread join processing --- source/client/src/clientStmt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/client/src/clientStmt.c b/source/client/src/clientStmt.c index 11cd87739e..eee7452dae 100644 --- a/source/client/src/clientStmt.c +++ b/source/client/src/clientStmt.c @@ -1514,7 +1514,10 @@ int stmtClose(TAOS_STMT* stmt) { pStmt->queue.stopQueue = true; - taosMsleep(10); + if (pStmt->bindThreadInUse) { + taosThreadJoin(pStmt->bindThread, NULL); + pStmt->bindThreadInUse = false; + } STMT_DLOG("stmt %p closed, stbInterlaceMode: %d, statInfo: ctgGetTbMetaNum=>%" PRId64 ", getCacheTbInfo=>%" PRId64 ", parseSqlNum=>%" PRId64 ", pStmt->stat.bindDataNum=>%" PRId64 ", settbnameAPI:%u, bindAPI:%u, addbatchAPI:%u, execAPI:%u"