diff options
author | Thomas Munro <tmunro@postgresql.org> | 2019-06-21 10:57:07 +1200 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2019-06-21 10:57:32 +1200 |
commit | f7aebd7f74117a9b44eb6af575061fc16a728236 (patch) | |
tree | 661ac8d143b1ef549582bf72bfedb886cf0ecd5c /src | |
parent | 6dfc9464472ec283cf6b13ee67b42afc6346c533 (diff) | |
download | postgresql-f7aebd7f74117a9b44eb6af575061fc16a728236.tar.gz postgresql-f7aebd7f74117a9b44eb6af575061fc16a728236.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/storage/lmgr/proc.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 6ad504453b1..94b203f0fbd 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -1179,8 +1179,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable) /* * If we detected deadlock, give up without waiting. This must agree with - * CheckDeadLock's recovery code, except that we shouldn't release the - * semaphore since we haven't tried to lock it yet. + * CheckDeadLock's recovery code. */ if (early_deadlock) { @@ -1216,9 +1215,9 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable) /* * 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 - * sets MyProc->waitStatus = STATUS_ERROR, allowing us to know that we - * must report failure rather than success. + * deadlock is detected, the handler sets MyProc->waitStatus = + * STATUS_ERROR, allowing us to know that we must report failure rather + * than success. * * By delaying the check until we've waited for a bit, we can avoid * running the rather expensive deadlock-check code in most cases. @@ -1561,7 +1560,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. * RETURN: the next process in the wait queue. @@ -1696,8 +1695,7 @@ CheckDeadLock(void) * 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. - * This is quicker than checking our semaphore's state, since no kernel - * call is needed, and it is safe because we hold the lock partition lock. + * This is safe because we hold the lock partition lock. */ if (MyProc->links.prev == NULL || MyProc->links.next == NULL) |