[td-225] init semaphore
This commit is contained in:
parent
f343d6d320
commit
1777a19c30
|
@ -50,6 +50,7 @@ void doAsyncQuery(STscObj* pObj, SSqlObj* pSql, void (*fp)(), void* param, const
|
|||
pSql->maxRetry = TSDB_MAX_REPLICA_NUM;
|
||||
pSql->fp = fp;
|
||||
|
||||
sem_init(&pSql->rspSem, 0, 0);
|
||||
if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, TSDB_DEFAULT_PAYLOAD_SIZE)) {
|
||||
tscError("failed to malloc payload");
|
||||
tscQueueAsyncError(fp, param, TSDB_CODE_CLI_OUT_OF_MEMORY);
|
||||
|
|
|
@ -426,6 +426,7 @@ void tscFreeSqlObj(SSqlObj* pSql) {
|
|||
pCmd->allocSize = 0;
|
||||
|
||||
tfree(pSql->sqlstr);
|
||||
sem_destroy(&pSql->rspSem);
|
||||
free(pSql);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue