pub unsafe trait RawRwLockUpgradeDowngrade: RawRwLockUpgrade + RawRwLockDowngrade {
// Required methods
unsafe fn downgrade_upgradable(
&self,
guard: Self::UpgradableGuard,
) -> Self::SharedGuard;
unsafe fn downgrade_to_upgradable(
&self,
guard: Self::ExclusiveGuard,
) -> Self::UpgradableGuard;
}Expand description
Additional methods for RwLocks which support upgradable locks and lock
downgrading.
§Safety
Implementations must uphold the safety requirements of RawRwLock for
the additional methods provided by this trait. Downgrading from exclusive
to upgradable access must release to subsequent lock acquisitions.
Required Methods§
Sourceunsafe fn downgrade_upgradable(
&self,
guard: Self::UpgradableGuard,
) -> Self::SharedGuard
unsafe fn downgrade_upgradable( &self, guard: Self::UpgradableGuard, ) -> Self::SharedGuard
Downgrades an upgradable lock to a shared lock.
§Safety
This method requires the state for an upgradable acquisition of this lock held in the current context.
Sourceunsafe fn downgrade_to_upgradable(
&self,
guard: Self::ExclusiveGuard,
) -> Self::UpgradableGuard
unsafe fn downgrade_to_upgradable( &self, guard: Self::ExclusiveGuard, ) -> Self::UpgradableGuard
Downgrades an exclusive lock to an upgradable lock.
§Safety
This method requires the state for an exclusive acquisition of this lock held in the current context.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".