Fix typo and comments related to the recent no-wait lock improvements
authorMichael Paquier <[email protected]>
Thu, 23 May 2024 04:47:12 +0000 (13:47 +0900)
committerMichael Paquier <[email protected]>
Thu, 23 May 2024 04:47:12 +0000 (13:47 +0900)
The argument of dontWait at the top of ProcSleep() was documented
backwards, and there was a typo in lock.c.

Thinkos in 2346df6fc373.

Author: Will Mortensen
Reviewed-by: Jingxian Li, Michael Paquier
Discussion: https://postgr.es/m/CAMpnoC5f+eiS7tdy8PUpd_LacSTVT-pYpVooKfjHRQQmkHPZ2g@mail.gmail.com

src/backend/storage/lmgr/lock.c
src/backend/storage/lmgr/proc.c

index 9e4ddf72258c9b38323fa93b9c76282f2d9cbe18..f68c595c8a41f6e2ffac4d64d5e54a9e7059437a 100644 (file)
@@ -1060,7 +1060,7 @@ LockAcquireExtended(const LOCKTAG *locktag,
 
        /*
         * Check the proclock entry status. If dontWait = true, this is an
-        * expected case; otherwise, it will open happen if something in the
+        * expected case; otherwise, it will only happen if something in the
         * ipc communication doesn't work correctly.
         */
        if (!(proclock->holdMask & LOCKBIT_ON(lockmode)))
index a2900b6014a8efdb2e501bb5a0f21702dbdca71b..ce29da901213e7cc40b1f43c80b63ed00198f39e 100644 (file)
@@ -1054,8 +1054,8 @@ AuxiliaryPidGetProc(int pid)
  * at exit.
  *
  * Result: PROC_WAIT_STATUS_OK if we acquired the lock, PROC_WAIT_STATUS_ERROR
- * if not (if dontWait = true, this is a deadlock; if dontWait = false, we
- * would have had to wait).
+ * if not (if dontWait = true, we would have had to wait; if dontWait = false,
+ * this is a deadlock).
  *
  * ASSUME: that no one will fiddle with the queue until after
  *     we release the partition lock.