Commit bed756a8 authored by Tom Lane's avatar Tom Lane

Suppress some unused-variable complaints in new LOCK_DEBUG code.

Jeff Janes
parent 656ea810
...@@ -207,7 +207,8 @@ LOG_LWDEBUG(const char *where, LWLock *lock, const char *msg) ...@@ -207,7 +207,8 @@ LOG_LWDEBUG(const char *where, LWLock *lock, const char *msg)
ereport(LOG, ereport(LOG,
(errhidestmt(true), (errhidestmt(true),
errhidecontext(true), errhidecontext(true),
errmsg("%s(%s %d): %s", where, T_NAME(lock), T_ID(lock), msg))); errmsg("%s(%s %d): %s", where,
T_NAME(lock), T_ID(lock), msg)));
} }
} }
...@@ -879,7 +880,7 @@ LWLockDequeueSelf(LWLock *lock) ...@@ -879,7 +880,7 @@ LWLockDequeueSelf(LWLock *lock)
#ifdef LOCK_DEBUG #ifdef LOCK_DEBUG
{ {
/* not waiting anymore */ /* not waiting anymore */
uint32 nwaiters = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1); uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1);
Assert(nwaiters < MAX_BACKENDS); Assert(nwaiters < MAX_BACKENDS);
} }
#endif #endif
...@@ -1045,7 +1046,7 @@ LWLockAcquireCommon(LWLock *lock, LWLockMode mode, uint64 *valptr, uint64 val) ...@@ -1045,7 +1046,7 @@ LWLockAcquireCommon(LWLock *lock, LWLockMode mode, uint64 *valptr, uint64 val)
#ifdef LOCK_DEBUG #ifdef LOCK_DEBUG
{ {
/* not waiting anymore */ /* not waiting anymore */
uint32 nwaiters = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1); uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1);
Assert(nwaiters < MAX_BACKENDS); Assert(nwaiters < MAX_BACKENDS);
} }
#endif #endif
...@@ -1202,7 +1203,7 @@ LWLockAcquireOrWait(LWLock *lock, LWLockMode mode) ...@@ -1202,7 +1203,7 @@ LWLockAcquireOrWait(LWLock *lock, LWLockMode mode)
#ifdef LOCK_DEBUG #ifdef LOCK_DEBUG
{ {
/* not waiting anymore */ /* not waiting anymore */
uint32 nwaiters = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1); uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1);
Assert(nwaiters < MAX_BACKENDS); Assert(nwaiters < MAX_BACKENDS);
} }
#endif #endif
...@@ -1403,7 +1404,7 @@ LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval) ...@@ -1403,7 +1404,7 @@ LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval)
#ifdef LOCK_DEBUG #ifdef LOCK_DEBUG
{ {
/* not waiting anymore */ /* not waiting anymore */
uint32 nwaiters = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1); uint32 nwaiters PG_USED_FOR_ASSERTS_ONLY = pg_atomic_fetch_sub_u32(&lock->nwaiters, 1);
Assert(nwaiters < MAX_BACKENDS); Assert(nwaiters < MAX_BACKENDS);
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment