未验证 提交 fd9ca4c7 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #4218 from taosdata/patch/TD-2079

taosAcquireRef return a pointer, not an integer
......@@ -1108,7 +1108,7 @@ static void syncProcessBrokenLink(void *param) {
SSyncPeer *pPeer = param;
SSyncNode *pNode = pPeer->pSyncNode;
if (taosAcquireRef(tsSyncRefId, pNode->rid) < 0) return;
if (taosAcquireRef(tsSyncRefId, pNode->rid) == NULL) return;
pthread_mutex_lock(&(pNode->mutex));
sDebug("%s, TCP link is broken(%s)", pPeer->id, strerror(errno));
......
......@@ -77,8 +77,8 @@ void *acquireRelease(void *param) {
printf("a");
id = random() % pSpace->refNum;
code = taosAcquireRef(pSpace->rsetId, pSpace->p[id]);
if (code >= 0) {
void *p = taosAcquireRef(pSpace->rsetId, pSpace->p[id]);
if (p) {
usleep(id % 5 + 1);
taosReleaseRef(pSpace->rsetId, pSpace->p[id]);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册