Skip to content

Commit 25b93a2

Browse files
committed
Remove obsolete comments about sempahores from proc.c.
Commit 6753333 switched from a semaphore-based wait to a latch-based wait for ProcSleep()/ProcWakeup(), but left behind some stray references to semaphores. Back-patch to 9.5. Reviewed-by: Daniel Gustafsson, Michael Paquier Discussion: https://postgr.es/m/CA+hUKGLs5H6zhmgTijZ1OaJvC1sG0=AFXc1aHuce32tKiQrdEA@mail.gmail.com
1 parent 20e1cc8 commit 25b93a2

File tree

1 file changed

+6
-8
lines changed
  • src/backend/storage/lmgr

1 file changed

+6
-8
lines changed

src/backend/storage/lmgr/proc.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,8 +1196,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
11961196

11971197
/*
11981198
* If we detected deadlock, give up without waiting. This must agree with
1199-
* CheckDeadLock's recovery code, except that we shouldn't release the
1200-
* semaphore since we haven't tried to lock it yet.
1199+
* CheckDeadLock's recovery code.
12011200
*/
12021201
if (early_deadlock)
12031202
{
@@ -1233,9 +1232,9 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
12331232

12341233
/*
12351234
* Set timer so we can wake up after awhile and check for a deadlock. If a
1236-
* deadlock is detected, the handler releases the process's semaphore and
1237-
* sets MyProc->waitStatus = STATUS_ERROR, allowing us to know that we
1238-
* must report failure rather than success.
1235+
* deadlock is detected, the handler sets MyProc->waitStatus =
1236+
* STATUS_ERROR, allowing us to know that we must report failure rather
1237+
* than success.
12391238
*
12401239
* By delaying the check until we've waited for a bit, we can avoid
12411240
* running the rather expensive deadlock-check code in most cases.
@@ -1578,7 +1577,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
15781577

15791578

15801579
/*
1581-
* ProcWakeup -- wake up a process by releasing its private semaphore.
1580+
* ProcWakeup -- wake up a process by setting its latch.
15821581
*
15831582
* Also remove the process from the wait queue and set its links invalid.
15841583
* RETURN: the next process in the wait queue.
@@ -1713,8 +1712,7 @@ CheckDeadLock(void)
17131712
* we know that we don't have to wait anymore.
17141713
*
17151714
* We check by looking to see if we've been unlinked from the wait queue.
1716-
* This is quicker than checking our semaphore's state, since no kernel
1717-
* call is needed, and it is safe because we hold the lock partition lock.
1715+
* This is safe because we hold the lock partition lock.
17181716
*/
17191717
if (MyProc->links.prev == NULL ||
17201718
MyProc->links.next == NULL)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy