fix: refact mutex locking
This commit is contained in:
parent
45dc2ec1f2
commit
65903a7c0d
|
@ -1119,7 +1119,10 @@ int32_t tsdbCacheGetLastrowH(SLRUCache *pCache, tb_uid_t uid, STsdb *pTsdb, LRUH
|
||||||
taosMemoryFree(pRow);
|
taosMemoryFree(pRow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
taosThreadMutexUnlock(&pTsdb->lruMutex);
|
||||||
|
|
||||||
*handle = NULL;
|
*handle = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1131,15 +1134,11 @@ int32_t tsdbCacheGetLastrowH(SLRUCache *pCache, tb_uid_t uid, STsdb *pTsdb, LRUH
|
||||||
}
|
}
|
||||||
|
|
||||||
taosThreadMutexUnlock(&pTsdb->lruMutex);
|
taosThreadMutexUnlock(&pTsdb->lruMutex);
|
||||||
|
|
||||||
|
h = taosLRUCacheLookup(pCache, key, keyLen);
|
||||||
} else {
|
} else {
|
||||||
taosThreadMutexUnlock(&pTsdb->lruMutex);
|
taosThreadMutexUnlock(&pTsdb->lruMutex);
|
||||||
|
|
||||||
*handle = h;
|
|
||||||
|
|
||||||
return code;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h = taosLRUCacheLookup(pCache, key, keyLen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*handle = h;
|
*handle = h;
|
||||||
|
|
Loading…
Reference in New Issue