]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Remove more obsolete comments about semaphores.
authorThomas Munro <tmunro@postgresql.org>
Fri, 9 Jul 2021 05:51:48 +0000 (17:51 +1200)
committerThomas Munro <tmunro@postgresql.org>
Fri, 9 Jul 2021 06:06:34 +0000 (18:06 +1200)
Commit 6753333f stopped using semaphores as the sleep/wake mechanism for
heavyweight locks, but some obsolete references to that scheme remained
in comments.  As with similar commit 25b93a29, back-patch all the way.

Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://postgr.es/m/CA%2BhUKGLafjB1uzXcy%3D%3D2L3cy7rjHkqOVn7qRYGBjk%3D%3DtMJE7Yg%40mail.gmail.com

src/backend/storage/lmgr/lwlock.c

index 5aae23399579965c80bec2d3c276eea5d2547419..952a877e5fd13e187abd37de68cd8554db405c50 100644 (file)
@@ -1221,14 +1221,10 @@ LWLockAcquire(LWLock *lock, LWLockMode mode)
                /*
                 * Wait until awakened.
                 *
-                * Since we share the process wait semaphore with the regular lock
-                * manager and ProcWaitForSignal, and we may need to acquire an LWLock
-                * while one of those is pending, it is possible that we get awakened
-                * for a reason other than being signaled by LWLockRelease. If so,
-                * loop back and wait again.  Once we've gotten the LWLock,
-                * re-increment the sema by the number of additional signals received,
-                * so that the lock manager or signal manager will see the received
-                * signal when it next waits.
+                * It is possible that we get awakened for a reason other than being
+                * signaled by LWLockRelease.  If so, loop back and wait again.  Once
+                * we've gotten the LWLock, re-increment the sema by the number of
+                * additional signals received.
                 */
                LOG_LWDEBUG("LWLockAcquire", lock, "waiting");
 
@@ -1388,8 +1384,7 @@ LWLockAcquireOrWait(LWLock *lock, LWLockMode mode)
                {
                        /*
                         * Wait until awakened.  Like in LWLockAcquire, be prepared for
-                        * bogus wakeups, because we share the semaphore with
-                        * ProcWaitForSignal.
+                        * bogus wakeups.
                         */
                        LOG_LWDEBUG("LWLockAcquireOrWait", lock, "waiting");
 
@@ -1598,14 +1593,10 @@ LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval)
                /*
                 * Wait until awakened.
                 *
-                * Since we share the process wait semaphore with the regular lock
-                * manager and ProcWaitForSignal, and we may need to acquire an LWLock
-                * while one of those is pending, it is possible that we get awakened
-                * for a reason other than being signaled by LWLockRelease. If so,
-                * loop back and wait again.  Once we've gotten the LWLock,
-                * re-increment the sema by the number of additional signals received,
-                * so that the lock manager or signal manager will see the received
-                * signal when it next waits.
+                * It is possible that we get awakened for a reason other than being
+                * signaled by LWLockRelease.  If so, loop back and wait again.  Once
+                * we've gotten the LWLock, re-increment the sema by the number of
+                * additional signals received.
                 */
                LOG_LWDEBUG("LWLockWaitForVar", lock, "waiting");