fix:sml core dump if insert quickly because of spin lock destroy

This commit is contained in:
wangmm0220 2022-10-13 19:35:43 +08:00
parent 0e734f7aee
commit 8067febe27
1 changed files with 3 additions and 2 deletions

View File

@ -2464,11 +2464,12 @@ static void smlInsertCallback(void *param, void *res, int32_t code) {
}else{
pParam->request->body.resInfo.numOfRows += info->affectedRows;
}
// unlock
taosThreadSpinUnlock(&pParam->lock);
if (pParam->cnt == pParam->total) {
tsem_post(&pParam->sem);
}
taosThreadSpinUnlock(&pParam->lock);
// unlock
uDebug("SML:0x%" PRIx64 " insert finished, code: %d, rows: %d, total: %d", info->id, code, rows, info->affectedRows);
info->cost.endTime = taosGetTimestampUs();
info->cost.code = code;