summaryrefslogtreecommitdiff
path: root/src/backend/storage/lmgr/lock.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-11-04 16:20:57 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-11-04 16:20:57 +0200
commit0464f25b6aa156228982efd46303e8c8dd25cccc (patch)
tree5cc392d6bd5f54252920049eedda215e9980bd3a /src/backend/storage/lmgr/lock.c
parent62620b6aadcedf453989e6b426f6ef3284c64bed (diff)
Set MyProc->heldLocks in ProcSleep
Previously, ProcSleep()'s caller was responsible for setting MyProc->heldLocks, and we had comments to remind about that. But it seems simpler to make ProcSleep() itself responsible for it. ProcSleep() already set the other info about the lock its waiting for (waitLock, waitProcLock and waitLockMode), so it is natural for it to set heldLocks too. Reviewed-by: Maxim Orlov Discussion: https://www.postgresql.org/message-id/7c2090cd-a72a-4e34-afaa-6dd2ef31440e@iki.fi
Diffstat (limited to 'src/backend/storage/lmgr/lock.c')
-rw-r--r--src/backend/storage/lmgr/lock.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c
index b273ff1afd3..8abd9837293 100644
--- a/src/backend/storage/lmgr/lock.c
+++ b/src/backend/storage/lmgr/lock.c
@@ -1096,11 +1096,6 @@ LockAcquireExtended(const LOCKTAG *locktag,
else
{
/*
- * Set bitmask of locks this process already holds on this object.
- */
- MyProc->heldLocks = proclock->holdMask;
-
- /*
* Sleep till someone wakes me up. We do this even in the dontWait
* case, because while trying to go to sleep, we may discover that we
* can acquire the lock immediately after all.
@@ -1856,9 +1851,6 @@ MarkLockClear(LOCALLOCK *locallock)
/*
* WaitOnLock -- wait to acquire a lock
*
- * Caller must have set MyProc->heldLocks to reflect locks already held
- * on the lockable object by this process.
- *
* The appropriate partition lock must be held at entry, and will still be
* held at exit.
*/