Skip to content

Commit 2f78338

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 56ff8b2 commit 2f78338

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
@@ -1298,14 +1298,10 @@ LWLockAcquire(LWLock *lock, LWLockMode mode)
12981298
/*
12991299
* Wait until awakened.
13001300
*
1301-
* Since we share the process wait semaphore with the regular lock
1302-
* manager and ProcWaitForSignal, and we may need to acquire an LWLock
1303-
* while one of those is pending, it is possible that we get awakened
1304-
* for a reason other than being signaled by LWLockRelease. If so,
1305-
* loop back and wait again. Once we've gotten the LWLock,
1306-
* re-increment the sema by the number of additional signals received,
1307-
* so that the lock manager or signal manager will see the received
1308-
* signal when it next waits.
1301+
* It is possible that we get awakened for a reason other than being
1302+
* signaled by LWLockRelease. If so, loop back and wait again. Once
1303+
* we've gotten the LWLock, re-increment the sema by the number of
1304+
* additional signals received.
13091305
*/
13101306
LOG_LWDEBUG("LWLockAcquire", lock, "waiting");
13111307

@@ -1470,8 +1466,7 @@ LWLockAcquireOrWait(LWLock *lock, LWLockMode mode)
14701466
{
14711467
/*
14721468
* Wait until awakened. Like in LWLockAcquire, be prepared for
1473-
* bogus wakeups, because we share the semaphore with
1474-
* ProcWaitForSignal.
1469+
* bogus wakeups.
14751470
*/
14761471
LOG_LWDEBUG("LWLockAcquireOrWait", lock, "waiting");
14771472

@@ -1684,14 +1679,10 @@ LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval)
16841679
/*
16851680
* Wait until awakened.
16861681
*
1687-
* Since we share the process wait semaphore with the regular lock
1688-
* manager and ProcWaitForSignal, and we may need to acquire an LWLock
1689-
* while one of those is pending, it is possible that we get awakened
1690-
* for a reason other than being signaled by LWLockRelease. If so,
1691-
* loop back and wait again. Once we've gotten the LWLock,
1692-
* re-increment the sema by the number of additional signals received,
1693-
* so that the lock manager or signal manager will see the received
1694-
* signal when it next waits.
1682+
* It is possible that we get awakened for a reason other than being
1683+
* signaled by LWLockRelease. If so, loop back and wait again. Once
1684+
* we've gotten the LWLock, re-increment the sema by the number of
1685+
* additional signals received.
16951686
*/
16961687
LOG_LWDEBUG("LWLockWaitForVar", lock, "waiting");
16971688

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy