Skip to content

Commit 7dd2379

Browse files
committed
Remove more obsolete comments about semaphores.
Commit 6753333 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 25b93a2, 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
1 parent 8710300 commit 7dd2379

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

src/backend/storage/lmgr/lwlock.c

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,14 +1307,10 @@ LWLockAcquire(LWLock *lock, LWLockMode mode)
13071307
/*
13081308
* Wait until awakened.
13091309
*
1310-
* Since we share the process wait semaphore with the regular lock
1311-
* manager and ProcWaitForSignal, and we may need to acquire an LWLock
1312-
* while one of those is pending, it is possible that we get awakened
1313-
* for a reason other than being signaled by LWLockRelease. If so,
1314-
* loop back and wait again. Once we've gotten the LWLock,
1315-
* re-increment the sema by the number of additional signals received,
1316-
* so that the lock manager or signal manager will see the received
1317-
* signal when it next waits.
1310+
* It is possible that we get awakened for a reason other than being
1311+
* signaled by LWLockRelease. If so, loop back and wait again. Once
1312+
* we've gotten the LWLock, re-increment the sema by the number of
1313+
* additional signals received.
13181314
*/
13191315
LOG_LWDEBUG("LWLockAcquire", lock, "waiting");
13201316

@@ -1479,8 +1475,7 @@ LWLockAcquireOrWait(LWLock *lock, LWLockMode mode)
14791475
{
14801476
/*
14811477
* Wait until awakened. Like in LWLockAcquire, be prepared for
1482-
* bogus wakeups, because we share the semaphore with
1483-
* ProcWaitForSignal.
1478+
* bogus wakeups.
14841479
*/
14851480
LOG_LWDEBUG("LWLockAcquireOrWait", lock, "waiting");
14861481

@@ -1693,14 +1688,10 @@ LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval)
16931688
/*
16941689
* Wait until awakened.
16951690
*
1696-
* Since we share the process wait semaphore with the regular lock
1697-
* manager and ProcWaitForSignal, and we may need to acquire an LWLock
1698-
* while one of those is pending, it is possible that we get awakened
1699-
* for a reason other than being signaled by LWLockRelease. If so,
1700-
* loop back and wait again. Once we've gotten the LWLock,
1701-
* re-increment the sema by the number of additional signals received,
1702-
* so that the lock manager or signal manager will see the received
1703-
* signal when it next waits.
1691+
* It is possible that we get awakened for a reason other than being
1692+
* signaled by LWLockRelease. If so, loop back and wait again. Once
1693+
* we've gotten the LWLock, re-increment the sema by the number of
1694+
* additional signals received.
17041695
*/
17051696
LOG_LWDEBUG("LWLockWaitForVar", lock, "waiting");
17061697

0 commit comments

Comments
 (0)