From 401d046b70c6e211093f03b540664840222ec05b Mon Sep 17 00:00:00 2001 From: slguan Date: Sat, 20 Jul 2019 17:31:34 +0800 Subject: [PATCH] Fix the issue #130, reference count may have a problem --- src/util/src/tcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/src/tcache.c b/src/util/src/tcache.c index ab887637cb..61d888607a 100644 --- a/src/util/src/tcache.c +++ b/src/util/src/tcache.c @@ -522,7 +522,7 @@ void *taosGetDataFromCache(void *handle, char *key) { pthread_rwlock_rdlock(&pObj->lock); SDataNode *ptNode = taosGetNodeFromHashTable(handle, key, keyLen); if (ptNode != NULL) { - ptNode->refCount += 1; + __sync_add_and_fetch_32(&ptNode->refCount, 1); } pthread_rwlock_unlock(&pObj->lock); -- GitLab