Fix lost-wakeup in RwMutexUpgradeableGuard_.drop()

This commit is contained in:
Ruize Tang
2024-09-09 16:18:03 +08:00
committed by Tate, Hongliang Tian
parent 7a08d9a660
commit bebfc360da

View File

@ -377,7 +377,7 @@ impl<T: ?Sized, R: Deref<Target = RwMutex<T>>> Deref for RwMutexUpgradeableGuard
impl<T: ?Sized, R: Deref<Target = RwMutex<T>>> Drop for RwMutexUpgradeableGuard_<T, R> {
fn drop(&mut self) {
let res = self.inner.lock.fetch_sub(UPGRADEABLE_READER, Release);
if res == 0 {
if res == UPGRADEABLE_READER {
self.inner.queue.wake_all();
}
}