Skip to content

Commit c0385c6

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 b186211 commit c0385c6

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
@@ -1222,14 +1222,10 @@ LWLockAcquire(LWLock *lock, LWLockMode mode)
12221222
/*
12231223
* Wait until awakened.
12241224
*
1225-
* Since we share the process wait semaphore with the regular lock
1226-
* manager and ProcWaitForSignal, and we may need to acquire an LWLock
1227-
* while one of those is pending, it is possible that we get awakened
1228-
* for a reason other than being signaled by LWLockRelease. If so,
1229-
* loop back and wait again. Once we've gotten the LWLock,
1230-
* re-increment the sema by the number of additional signals received,
1231-
* so that the lock manager or signal manager will see the received
1232-
* signal when it next waits.
1225+
* It is possible that we get awakened for a reason other than being
1226+
* signaled by LWLockRelease. If so, loop back and wait again. Once
1227+
* we've gotten the LWLock, re-increment the sema by the number of
1228+
* additional signals received.
12331229
*/
12341230
LOG_LWDEBUG("LWLockAcquire", lock, "waiting");
12351231

@@ -1389,8 +1385,7 @@ LWLockAcquireOrWait(LWLock *lock, LWLockMode mode)
13891385
{
13901386
/*
13911387
* Wait until awakened. Like in LWLockAcquire, be prepared for
1392-
* bogus wakeups, because we share the semaphore with
1393-
* ProcWaitForSignal.
1388+
* bogus wakeups.
13941389
*/
13951390
LOG_LWDEBUG("LWLockAcquireOrWait", lock, "waiting");
13961391

@@ -1599,14 +1594,10 @@ LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval)
15991594
/*
16001595
* Wait until awakened.
16011596
*
1602-
* Since we share the process wait semaphore with the regular lock
1603-
* manager and ProcWaitForSignal, and we may need to acquire an LWLock
1604-
* while one of those is pending, it is possible that we get awakened
1605-
* for a reason other than being signaled by LWLockRelease. If so,
1606-
* loop back and wait again. Once we've gotten the LWLock,
1607-
* re-increment the sema by the number of additional signals received,
1608-
* so that the lock manager or signal manager will see the received
1609-
* signal when it next waits.
1597+
* It is possible that we get awakened for a reason other than being
1598+
* signaled by LWLockRelease. If so, loop back and wait again. Once
1599+
* we've gotten the LWLock, re-increment the sema by the number of
1600+
* additional signals received.
16101601
*/
16111602
LOG_LWDEBUG("LWLockWaitForVar", lock, "waiting");
16121603

0 commit comments

Comments
 (0)