lock_api

Trait RawRwLockUpgradeFair

Source
pub unsafe trait RawRwLockUpgradeFair: RawRwLockUpgrade + RawRwLockFair {
    // Required method
    unsafe fn unlock_upgradable_fair(&self);

    // Provided method
    unsafe fn bump_upgradable(&self) { ... }
}
Expand description

Additional methods for RwLocks which support upgradable locks and fair unlocking.

Required Methods§

Source

unsafe fn unlock_upgradable_fair(&self)

Releases an upgradable lock using a fair unlock protocol.

§Safety

This method may only be called if an upgradable lock is held in the current context.

Provided Methods§

Source

unsafe fn bump_upgradable(&self)

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 may only be called if an upgradable lock is held in the current context.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§