Commit 25b93a29 authored by Thomas Munro's avatar Thomas Munro

Remove obsolete comments about sempahores from proc.c.

Commit 6753333f 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
parent 20e1cc89
...@@ -1196,8 +1196,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable) ...@@ -1196,8 +1196,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
/* /*
* If we detected deadlock, give up without waiting. This must agree with * If we detected deadlock, give up without waiting. This must agree with
* CheckDeadLock's recovery code, except that we shouldn't release the * CheckDeadLock's recovery code.
* semaphore since we haven't tried to lock it yet.
*/ */
if (early_deadlock) if (early_deadlock)
{ {
...@@ -1233,9 +1232,9 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable) ...@@ -1233,9 +1232,9 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
/* /*
* Set timer so we can wake up after awhile and check for a deadlock. If a * Set timer so we can wake up after awhile and check for a deadlock. If a
* deadlock is detected, the handler releases the process's semaphore and * deadlock is detected, the handler sets MyProc->waitStatus =
* sets MyProc->waitStatus = STATUS_ERROR, allowing us to know that we * STATUS_ERROR, allowing us to know that we must report failure rather
* must report failure rather than success. * than success.
* *
* By delaying the check until we've waited for a bit, we can avoid * By delaying the check until we've waited for a bit, we can avoid
* running the rather expensive deadlock-check code in most cases. * running the rather expensive deadlock-check code in most cases.
...@@ -1578,7 +1577,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable) ...@@ -1578,7 +1577,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
/* /*
* ProcWakeup -- wake up a process by releasing its private semaphore. * ProcWakeup -- wake up a process by setting its latch.
* *
* Also remove the process from the wait queue and set its links invalid. * Also remove the process from the wait queue and set its links invalid.
* RETURN: the next process in the wait queue. * RETURN: the next process in the wait queue.
...@@ -1713,8 +1712,7 @@ CheckDeadLock(void) ...@@ -1713,8 +1712,7 @@ CheckDeadLock(void)
* we know that we don't have to wait anymore. * we know that we don't have to wait anymore.
* *
* We check by looking to see if we've been unlinked from the wait queue. * We check by looking to see if we've been unlinked from the wait queue.
* This is quicker than checking our semaphore's state, since no kernel * This is safe because we hold the lock partition lock.
* call is needed, and it is safe because we hold the lock partition lock.
*/ */
if (MyProc->links.prev == NULL || if (MyProc->links.prev == NULL ||
MyProc->links.next == NULL) MyProc->links.next == NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment