@@ -207,7 +207,8 @@ LOG_LWDEBUG(const char *where, LWLock *lock, const char *msg)
207207 ereport (LOG ,
208208 (errhidestmt (true),
209209 errhidecontext (true),
210- errmsg ("%s(%s %d): %s" , where , T_NAME (lock ), T_ID (lock ), msg )));
210+ errmsg ("%s(%s %d): %s" , where ,
211+ T_NAME (lock ), T_ID (lock ), msg )));
211212 }
212213}
213214
@@ -879,7 +880,7 @@ LWLockDequeueSelf(LWLock *lock)
879880#ifdef LOCK_DEBUG
880881 {
881882 /* not waiting anymore */
882- uint32 nwaiters = pg_atomic_fetch_sub_u32 (& lock -> nwaiters , 1 );
883+ uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32 (& lock -> nwaiters , 1 );
883884 Assert (nwaiters < MAX_BACKENDS );
884885 }
885886#endif
@@ -1045,7 +1046,7 @@ LWLockAcquireCommon(LWLock *lock, LWLockMode mode, uint64 *valptr, uint64 val)
10451046#ifdef LOCK_DEBUG
10461047 {
10471048 /* not waiting anymore */
1048- uint32 nwaiters = pg_atomic_fetch_sub_u32 (& lock -> nwaiters , 1 );
1049+ uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32 (& lock -> nwaiters , 1 );
10491050 Assert (nwaiters < MAX_BACKENDS );
10501051 }
10511052#endif
@@ -1202,7 +1203,7 @@ LWLockAcquireOrWait(LWLock *lock, LWLockMode mode)
12021203#ifdef LOCK_DEBUG
12031204 {
12041205 /* not waiting anymore */
1205- uint32 nwaiters = pg_atomic_fetch_sub_u32 (& lock -> nwaiters , 1 );
1206+ uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32 (& lock -> nwaiters , 1 );
12061207 Assert (nwaiters < MAX_BACKENDS );
12071208 }
12081209#endif
@@ -1403,7 +1404,7 @@ LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval)
14031404#ifdef LOCK_DEBUG
14041405 {
14051406 /* not waiting anymore */
1406- uint32 nwaiters = pg_atomic_fetch_sub_u32 (& lock -> nwaiters , 1 );
1407+ uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32 (& lock -> nwaiters , 1 );
14071408 Assert (nwaiters < MAX_BACKENDS );
14081409 }
14091410#endif
0 commit comments