about summary refs log tree commit diff
path: root/library/std/src/sys
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2022-04-08 16:07:07 +0200
committerGitHub <noreply@github.com>2022-04-08 16:07:07 +0200
commit307aa588f42b65cbce27f0e366197e27ef531c77 (patch)
treec4d3b7b64a35f7f759e0217aa9275d6581c48e97 /library/std/src/sys
parent6cb463cb112a05298ce2467085b64dfb4a3d63b3 (diff)
downloadrust-307aa588f42b65cbce27f0e366197e27ef531c77.tar.gz
rust-307aa588f42b65cbce27f0e366197e27ef531c77.zip
Fix typo in futex rwlock.
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
Diffstat (limited to 'library/std/src/sys')
-rw-r--r--library/std/src/sys/unix/locks/futex_rwlock.rs2
1 files changed, 1 insertions, 1 deletions
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.