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)
ereport(LOG,
(errhidestmt(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)
#ifdef LOCK_DEBUG
{
/* 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);
}
#endif
......@@ -1045,7 +1046,7 @@ LWLockAcquireCommon(LWLock *lock, LWLockMode mode, uint64 *valptr, uint64 val)
#ifdef LOCK_DEBUG
{
/* 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);
}
#endif
......@@ -1202,7 +1203,7 @@ LWLockAcquireOrWait(LWLock *lock, LWLockMode mode)
#ifdef LOCK_DEBUG
{
/* 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);
}
#endif
......@@ -1403,7 +1404,7 @@ LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval)
#ifdef LOCK_DEBUG
{
/* 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);
}
#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