Fix lost-wakeup in RwMutexUpgradeableGuard_.drop()
This commit is contained in:
parent
7a08d9a660
commit
bebfc360da
|
|
@ -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> {
|
impl<T: ?Sized, R: Deref<Target = RwMutex<T>>> Drop for RwMutexUpgradeableGuard_<T, R> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let res = self.inner.lock.fetch_sub(UPGRADEABLE_READER, Release);
|
let res = self.inner.lock.fetch_sub(UPGRADEABLE_READER, Release);
|
||||||
if res == 0 {
|
if res == UPGRADEABLE_READER {
|
||||||
self.inner.queue.wake_all();
|
self.inner.queue.wake_all();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue