rwlock: use fcmpset for setting RW_LOCK_WRITE_SPINNER

This commit is contained in:
mjg 2017-11-11 09:34:11 +00:00
parent dd7fc76e27
commit 41984bdd76

View File

@ -929,9 +929,8 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, uintptr_t tid,
if ((v & RW_LOCK_READ) && RW_READERS(v) &&
spintries < rowner_retries) {
if (!(v & RW_LOCK_WRITE_SPINNER)) {
if (!atomic_cmpset_ptr(&rw->rw_lock, v,
if (!atomic_fcmpset_ptr(&rw->rw_lock, &v,
v | RW_LOCK_WRITE_SPINNER)) {
v = RW_READ_VALUE(rw);
continue;
}
}