stmt2/close: wait only when !semWaited (i.e. execed current batch)

This commit is contained in:
Minglei Jin 2024-09-12 15:27:11 +08:00
parent e7cfe21e72
commit aecab6e2ca
1 changed files with 1 additions and 1 deletions

View File

@ -1701,7 +1701,7 @@ int stmtClose2(TAOS_STMT2* stmt) {
pStmt->bindThreadInUse = false;
}
if (pStmt->options.asyncExecFn) {
if (pStmt->options.asyncExecFn && !pStmt->semWaited) {
(void)tsem_wait(&pStmt->asyncQuerySem);
}