From 3f8053adde0da2c99fd1e02f464a7247c73f0887 Mon Sep 17 00:00:00 2001
From: Sami Imseih <samimseih@gmail.com>
Date: Fri, 27 Mar 2026 04:46:55 +0000
Subject: [PATCH v1 1/1] fix some comments for lwlock tranches

---
 src/backend/storage/lmgr/lwlock.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
index 241f1f08430..2ee385698e5 100644
--- a/src/backend/storage/lmgr/lwlock.c
+++ b/src/backend/storage/lmgr/lwlock.c
@@ -200,7 +200,7 @@ typedef struct LWLockTrancheShmemData
 
 static LWLockTrancheShmemData *LWLockTranches;
 
-/* backend-local copy of NamedLWLockTranches->num_user_defined */
+/* backend-local copy of LWLockTranches->num_user_defined */
 static int	LocalNumUserDefinedTranches;
 
 /*
@@ -460,7 +460,7 @@ LWLockShmemInit(void)
 }
 
 /*
- * Initialize LWLocks that are fixed and those belonging to named tranches.
+ * Initialize LWLocks that are fixed and those belonging to user-defined tranches.
  */
 static void
 InitializeLWLocks(int numLocks)
@@ -487,7 +487,7 @@ InitializeLWLocks(int numLocks)
 		LWLockInitialize(&MainLWLockArray[pos++].lock, LWTRANCHE_PREDICATE_LOCK_MANAGER);
 
 	/*
-	 * Copy the info about any named tranches into shared memory (so that
+	 * Copy the info about any user-defined tranches into shared memory (so that
 	 * other processes can see it), and initialize the requested LWLocks.
 	 */
 	Assert(pos == NUM_FIXED_LWLOCKS);
@@ -536,8 +536,9 @@ GetNamedLWLockTranche(const char *tranche_name)
 
 	/*
 	 * Obtain the position of base address of LWLock belonging to requested
-	 * tranche_name in MainLWLockArray.  LWLocks for named tranches are placed
-	 * in MainLWLockArray after fixed locks.
+	 * tranche_name in MainLWLockArray.  LWLocks for user-defined tranches
+	 * requested with RequestNamedLWLockTranche() are placed in
+	 * MainLWLockArray after fixed locks.
 	 */
 	for (int i = 0; i < LocalNumUserDefinedTranches; i++)
 	{
-- 
2.47.3

