From bdc01f0370675b3ed7f8a97eb8b2e08d4f46d32a Mon Sep 17 00:00:00 2001 From: Noah <33094578+coolreader18@users.noreply.github.com> Date: Fri, 5 Feb 2021 23:13:16 -0600 Subject: [PATCH] Fix bug for downgrading cell locks --- common/src/lock/cell_lock.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/lock/cell_lock.rs b/common/src/lock/cell_lock.rs index 32c4116cb..edf968b3f 100644 --- a/common/src/lock/cell_lock.rs +++ b/common/src/lock/cell_lock.rs @@ -121,7 +121,7 @@ unsafe impl RawRwLock for RawCellRwLock { unsafe impl RawRwLockDowngrade for RawCellRwLock { unsafe fn downgrade(&self) { - // no-op -- we're always exclusively locked for this thread + self.state.set(ONE_READER); } } @@ -170,7 +170,7 @@ unsafe impl RawRwLockUpgradeDowngrade for RawCellRwLock { #[inline] unsafe fn downgrade_to_upgradable(&self) { - // no-op -- we're always exclusively locked for this thread + self.state.set(ONE_READER); } }