rwlock: fix r313454
The runlock slow path would update wrong variable before restarting the loop, in effect corrupting the state. Reported by: pho
This commit is contained in:
parent
bcee8cb651
commit
5f5fddd5ed
@ -755,7 +755,7 @@ __rw_runlock_hard(volatile uintptr_t *c, struct thread *td, uintptr_t v,
|
||||
if (!atomic_cmpset_rel_ptr(&rw->rw_lock, RW_READERS_LOCK(1) | v,
|
||||
x)) {
|
||||
turnstile_chain_unlock(&rw->lock_object);
|
||||
x = RW_READ_VALUE(rw);
|
||||
v = RW_READ_VALUE(rw);
|
||||
continue;
|
||||
}
|
||||
if (LOCK_LOG_TEST(&rw->lock_object, 0))
|
||||
|
Loading…
x
Reference in New Issue
Block a user