diff --git a/src/sync/src/syncMain.c b/src/sync/src/syncMain.c index 44f66bc70c9c6c8b9246fc31ebbaa1d2665fe6df..93739ca3d14a2895aedb3bbe37085c95ac722c96 100644 --- a/src/sync/src/syncMain.c +++ b/src/sync/src/syncMain.c @@ -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)); diff --git a/src/util/tests/trefTest.c b/src/util/tests/trefTest.c index 6887b24abdae9f5d9949fee0073a35eb717eb4f7..454860410b4dd0c3fdf65c4b7fd7950a1a7d4446 100644 --- a/src/util/tests/trefTest.c +++ b/src/util/tests/trefTest.c @@ -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]); }