]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Minor comment fixes to yesterday's LWLock tranche refactoring
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 27 Mar 2026 09:44:10 +0000 (11:44 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 27 Mar 2026 09:44:10 +0000 (11:44 +0200)
Author: Sami Imseih <samimseih@gmail.com>
Discussion: https://www.postgresql.org/message-id/CAA5RZ0sLENRM+BicUjQFs_rP38oPx3gm0SsGrD0-jMhhM+HZ_w@mail.gmail.com

src/backend/storage/lmgr/lwlock.c

index 241f1f08430c10f19e84018e0c64dd96edbc84e2..7a68071302a0e6fb2725ec2ec3a5c8dd0197843d 100644 (file)
@@ -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,8 @@ LWLockShmemInit(void)
 }
 
 /*
- * Initialize LWLocks that are fixed and those belonging to named tranches.
+ * Initialize LWLocks for built-in tranches and those requested with
+ * RequestNamedLWLockTranche().
  */
 static void
 InitializeLWLocks(int numLocks)
@@ -487,8 +488,8 @@ InitializeLWLocks(int numLocks)
                LWLockInitialize(&MainLWLockArray[pos++].lock, LWTRANCHE_PREDICATE_LOCK_MANAGER);
 
        /*
-        * Copy the info about any named tranches into shared memory (so that
-        * other processes can see it), and initialize the requested LWLocks.
+        * 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);
        foreach_ptr(NamedLWLockTrancheRequest, request, NamedLWLockTrancheRequests)
@@ -536,8 +537,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++)
        {