[td-225] refactor codes.
This commit is contained in:
parent
e47e6300e4
commit
b52bae71ae
|
@ -300,7 +300,7 @@ void *taosCacheAcquireByKey(SCacheObj *pCacheObj, const void *key, size_t keyLen
|
||||||
|
|
||||||
void *pData = NULL;
|
void *pData = NULL;
|
||||||
|
|
||||||
__cache_rd_lock(pCacheObj);
|
// __cache_rd_lock(pCacheObj);
|
||||||
SCacheDataNode **ptNode = (SCacheDataNode **)taosHashGet(pCacheObj->pHashTable, key, keyLen);
|
SCacheDataNode **ptNode = (SCacheDataNode **)taosHashGet(pCacheObj->pHashTable, key, keyLen);
|
||||||
|
|
||||||
int32_t ref = 0;
|
int32_t ref = 0;
|
||||||
|
@ -309,7 +309,7 @@ void *taosCacheAcquireByKey(SCacheObj *pCacheObj, const void *key, size_t keyLen
|
||||||
pData = (*ptNode)->data;
|
pData = (*ptNode)->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
__cache_unlock(pCacheObj);
|
// __cache_unlock(pCacheObj);
|
||||||
|
|
||||||
if (pData != NULL) {
|
if (pData != NULL) {
|
||||||
atomic_add_fetch_32(&pCacheObj->statistics.hitCount, 1);
|
atomic_add_fetch_32(&pCacheObj->statistics.hitCount, 1);
|
||||||
|
|
Loading…
Reference in New Issue