Fix comment in LockReleaseAll() on when locallock->nLock can be zero

We reach this case also e.g. when a deadlock is detected, not only
when we run out of memory.

Reviewed-by: Maxim Orlov
Discussion: https://www.postgresql.org/message-id/7c2090cd-a72a-4e34-afaa-6dd2ef31440e@iki.fi
This commit is contained in:
Heikki Linnakangas 2024-11-04 15:31:46 +02:00
parent 99b937a44f
commit 1fe0466cf2

View File

@ -2258,9 +2258,8 @@ LockReleaseAll(LOCKMETHODID lockmethodid, bool allLocks)
while ((locallock = (LOCALLOCK *) hash_seq_search(&status)) != NULL) while ((locallock = (LOCALLOCK *) hash_seq_search(&status)) != NULL)
{ {
/* /*
* If the LOCALLOCK entry is unused, we must've run out of shared * If the LOCALLOCK entry is unused, something must've gone wrong
* memory while trying to set up this lock. Just forget the local * while trying to acquire this lock. Just forget the local entry.
* entry.
*/ */
if (locallock->nLocks == 0) if (locallock->nLocks == 0)
{ {