diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2017-12-31 00:31:14 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2017-12-31 00:31:14 +0000 |
commit | 80c39f6c374bd412b6c88e63268094030d77245c (patch) | |
tree | d6de903a1f4bbf1b4285add0f2e1f7189a097e6e /sys | |
parent | 74e0613eadf490daeb9d147b9e5cf03ee7f17203 (diff) | |
download | src-test2-80c39f6c374bd412b6c88e63268094030d77245c.tar.gz src-test2-80c39f6c374bd412b6c88e63268094030d77245c.zip |
Notes
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_rwlock.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c index 70a8cdd3681c..9eac607ab317 100644 --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -755,7 +755,7 @@ __rw_runlock_hard(struct rwlock *rw, struct thread *td, uintptr_t v LOCK_FILE_LINE_ARG_DEF) { struct turnstile *ts; - uintptr_t x, queue; + uintptr_t setv, queue; if (SCHEDULER_STOPPED()) return; @@ -795,14 +795,14 @@ retry_ts: * acquired a read lock, so drop the turnstile lock and * restart. */ - x = RW_UNLOCKED; + setv = RW_UNLOCKED; + queue = TS_SHARED_QUEUE; if (v & RW_LOCK_WRITE_WAITERS) { queue = TS_EXCLUSIVE_QUEUE; - x |= (v & RW_LOCK_READ_WAITERS); - } else - queue = TS_SHARED_QUEUE; + setv |= (v & RW_LOCK_READ_WAITERS); + } v |= RW_READERS_LOCK(1); - if (!atomic_fcmpset_rel_ptr(&rw->rw_lock, &v, x)) + if (!atomic_fcmpset_rel_ptr(&rw->rw_lock, &v, setv)) goto retry_ts; if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p last succeeded with waiters", |