summaryrefslogtreecommitdiff
path: root/usr/src/lib/libc/port/threads
diff options
context:
space:
mode:
authorDan McDonald <danmcd@joyent.com>2020-09-22 10:39:49 -0400
committerDan McDonald <danmcd@joyent.com>2020-09-22 10:39:49 -0400
commit267e12a7d9bf6e5fcefb9cc00f46bfff0dc5226e (patch)
tree19a3941920d0039c35d53a5cbee189b5ca51995a /usr/src/lib/libc/port/threads
parent517abc5c668925e6092495bf332233c3599980d2 (diff)
parente9faba760cdf80d7dfa110fe0830917ab94668c2 (diff)
downloadillumos-joyent-vpc.tar.gz
Merge branch 'master' into vpcvpc
Diffstat (limited to 'usr/src/lib/libc/port/threads')
-rw-r--r--usr/src/lib/libc/port/threads/rwlock.c5
1 files changed, 4 insertions, 1 deletions
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