Skip to content

Commit 307aa58

Browse files
m-ou-seAmanieu
andauthored
Fix typo in futex rwlock.
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
1 parent 6cb463c commit 307aa58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/sys/unix/locks/futex_rwlock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl RwLock {
7777

7878
#[inline]
7979
pub unsafe fn read_unlock(&self) {
80-
let state = self.state.fetch_sub(READ_LOCKED, Release) - 1;
80+
let state = self.state.fetch_sub(READ_LOCKED, Release) - READ_LOCKED;
8181

8282
// It's impossible for a reader to be waiting on a read-locked RwLock,
8383
// except if there is also a writer waiting.

0 commit comments

Comments
 (0)