From 5d2ed7273d684a5ddeb0970c96ef9cf3ddd4e044 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Sun, 12 Apr 2020 23:07:56 +0300 Subject: 13115 libc: variable 'readers' set but not used Reviewed by: Patrick Mooney Reviewed by: Richard Lowe Approved by: Dan McDonald --- usr/src/lib/libc/port/threads/rwlock.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'usr/src/lib/libc/port/threads') diff --git a/usr/src/lib/libc/port/threads/rwlock.c b/usr/src/lib/libc/port/threads/rwlock.c index 9654b7daaf..faff5da953 100644 --- a/usr/src/lib/libc/port/threads/rwlock.c +++ b/usr/src/lib/libc/port/threads/rwlock.c @@ -505,7 +505,6 @@ shared_rwlock_lock(rwlock_t *rwlp, timespec_t *tsp, int rd_wr) { volatile uint32_t *rwstate = (volatile uint32_t *)&rwlp->rwlock_readers; mutex_t *mp = &rwlp->mutex; - uint32_t readers; int try_flag; int error; @@ -536,8 +535,12 @@ shared_rwlock_lock(rwlock_t *rwlp, timespec_t *tsp, int rd_wr) } } atomic_or_32(rwstate, URW_HAS_WAITERS); + +#ifdef THREAD_DEBUG + uint32_t readers; readers = *rwstate; ASSERT_CONSISTENT_STATE(readers); +#endif /* * The calls to __lwp_rwlock_*() below will release the mutex, * so we need a dtrace probe here. The owner field of the -- cgit v1.2.3