pub unsafe trait RawRwLockUpgradeFair: RawRwLockUpgrade + RawRwLockFair {
// Required method
unsafe fn unlock_upgradable_fair(&self, guard: Self::UpgradableGuard);
// Provided method
unsafe fn bump_upgradable(&self, guard: &mut Self::UpgradableGuard) { ... }
}Expand description
Required Methods§
Sourceunsafe fn unlock_upgradable_fair(&self, guard: Self::UpgradableGuard)
unsafe fn unlock_upgradable_fair(&self, guard: Self::UpgradableGuard)
Releases an upgradable lock using a fair unlock protocol.
§Safety
This method requires the state for an upgradable acquisition of this lock held in the current context.
Provided Methods§
Sourceunsafe fn bump_upgradable(&self, guard: &mut Self::UpgradableGuard)
unsafe fn bump_upgradable(&self, guard: &mut Self::UpgradableGuard)
Temporarily yields an upgradable lock to a waiting thread if there is one.
This method is functionally equivalent to calling unlock_upgradable_fair followed
by lock_upgradable, however it can be much more efficient in the case where there
are no waiting threads.
§Safety
This method requires the state for an upgradable acquisition of this lock held in the current context.
Implementations may unwind only with ownership in the original mode and valid guard state restored. If restoration fails, they must abort.
§Aborts
The default implementation aborts if re-locking the RwLock panics.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".