pub unsafe trait RawRwLockUpgradeTimed: RawRwLockUpgrade + RawRwLockTimed {
// Required methods
fn try_lock_upgradable_for(&self, timeout: Self::Duration) -> bool;
fn try_lock_upgradable_until(&self, timeout: Self::Instant) -> bool;
unsafe fn try_upgrade_for(&self, timeout: Self::Duration) -> bool;
unsafe fn try_upgrade_until(&self, timeout: Self::Instant) -> bool;
}
Expand description
Additional methods for RwLock
s which support upgradable locks and locking
with timeouts.
Required Methods§
Sourcefn try_lock_upgradable_for(&self, timeout: Self::Duration) -> bool
fn try_lock_upgradable_for(&self, timeout: Self::Duration) -> bool
Attempts to acquire an upgradable lock until a timeout is reached.
Sourcefn try_lock_upgradable_until(&self, timeout: Self::Instant) -> bool
fn try_lock_upgradable_until(&self, timeout: Self::Instant) -> bool
Attempts to acquire an upgradable lock until a timeout is reached.
Sourceunsafe fn try_upgrade_for(&self, timeout: Self::Duration) -> bool
unsafe fn try_upgrade_for(&self, timeout: Self::Duration) -> bool
Attempts to upgrade an upgradable lock to an exclusive lock until a timeout is reached.
§Safety
This method may only be called if an upgradable lock is held in the current context.
Sourceunsafe fn try_upgrade_until(&self, timeout: Self::Instant) -> bool
unsafe fn try_upgrade_until(&self, timeout: Self::Instant) -> bool
Attempts to upgrade an upgradable lock to an exclusive lock until a timeout is reached.
§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.