mirror of
https://github.com/pgvector/pgvector.git
synced 2026-06-29 17:21:16 +08:00
Use shared lock for copying neighbors to local memory
This commit is contained in:
@@ -781,7 +781,7 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
|
||||
/* Copy neighborhood to local memory if needed */
|
||||
if (index == NULL)
|
||||
{
|
||||
LWLockAcquire(&cElement->lock, LW_EXCLUSIVE);
|
||||
LWLockAcquire(&cElement->lock, LW_SHARED);
|
||||
memcpy(neighborhoodData, neighborhood, neighborhoodSize);
|
||||
LWLockRelease(&cElement->lock);
|
||||
neighborhood = neighborhoodData;
|
||||
|
||||
Reference in New Issue
Block a user