From: Heikki Linnakangas Date: Fri, 27 Mar 2026 09:44:10 +0000 (+0200) Subject: Minor comment fixes to yesterday's LWLock tranche refactoring X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=98993150c0a4c082cdb8864ae20c0bb934ad27cb;p=thirdparty%2Fpostgresql.git Minor comment fixes to yesterday's LWLock tranche refactoring Author: Sami Imseih Discussion: https://www.postgresql.org/message-id/CAA5RZ0sLENRM+BicUjQFs_rP38oPx3gm0SsGrD0-jMhhM+HZ_w@mail.gmail.com --- diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index 241f1f08430..7a68071302a 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,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++) {