fix deadlock while free tsc object

This commit is contained in:
Shengliang Guan 2020-05-29 11:10:34 +00:00
parent 1a9fc8047c
commit 706b535c61
1 changed files with 4 additions and 1 deletions

View File

@ -591,7 +591,10 @@ void taos_free_result_imp(TAOS_RES *res, int keepCmd) {
tscProcessSql(pSql);
// waits for response and then goes on
sem_wait(&pSql->rspSem);
STscObj* pTscObj = pSql->pTscObj;
if (pTscObj->pSql == pSql) {
sem_wait(&pSql->rspSem);
}
} else { // if no free resource msg is sent to vnode, we free this object immediately.
STscObj* pTscObj = pSql->pTscObj;