From 307aa588f42b65cbce27f0e366197e27ef531c77 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Fri, 8 Apr 2022 16:07:07 +0200 Subject: [PATCH] Fix typo in futex rwlock. Co-authored-by: Amanieu d'Antras --- library/std/src/sys/unix/locks/futex_rwlock.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/sys/unix/locks/futex_rwlock.rs b/library/std/src/sys/unix/locks/futex_rwlock.rs index 0665d7b3bfd..19ec6fa8349 100644 --- a/library/std/src/sys/unix/locks/futex_rwlock.rs +++ b/library/std/src/sys/unix/locks/futex_rwlock.rs @@ -77,7 +77,7 @@ impl RwLock { #[inline] pub unsafe fn read_unlock(&self) { - let state = self.state.fetch_sub(READ_LOCKED, Release) - 1; + let state = self.state.fetch_sub(READ_LOCKED, Release) - READ_LOCKED; // It's impossible for a reader to be waiting on a read-locked RwLock, // except if there is also a writer waiting.