diff --git a/library/std/src/sys/unix/locks/futex_rwlock.rs b/library/std/src/sys/unix/locks/futex_rwlock.rs index 57f6d58840d..5ff1aba7974 100644 --- a/library/std/src/sys/unix/locks/futex_rwlock.rs +++ b/library/std/src/sys/unix/locks/futex_rwlock.rs @@ -208,9 +208,8 @@ impl RwLock { // Don't go to sleep if the lock has become available, // or if the writers waiting bit is no longer set. - let s = self.state.load(Relaxed); - if is_unlocked(state) || !has_writers_waiting(s) { - state = s; + state = self.state.load(Relaxed); + if is_unlocked(state) || !has_writers_waiting(state) { continue; }