#[repr(transparent)]pub struct PiFutex<Scope> {
pub value: AtomicU32,
/* private fields */
}
Expand description
A Linux-specific priority inheriting fast user-space locking primitive.
Unlike with a regular Futex
, the value of a PiFutex
has meaning
to the Linux kernel, taking away some flexibility. User-space must follow
the assumed protocol to allow the kernel to properly implement priority
inheritance.
See the Priority-inheritance futexes section of the Linux futex man page for details.
PiFutex<Private>
may only be used from the same address space (the same
process) and is faster than a PiFutex<Shared>
, which may be used accross
address spaces (processes).
Fields§
§value: AtomicU32
Implementations§
Source§impl<S> PiFutex<S>
impl<S> PiFutex<S>
Sourcepub const WAITERS: u32 = 2_147_483_648u32
pub const WAITERS: u32 = 2_147_483_648u32
The FUTEX_WAITERS
bit that indicates there are threads waiting.
Sourcepub const OWNER_DIED: u32 = 1_073_741_824u32
pub const OWNER_DIED: u32 = 1_073_741_824u32
The FUTEX_OWNER_DIED
bit that indicates the owning thread died.
Source§impl<S: Scope> PiFutex<S>
impl<S: Scope> PiFutex<S>
Sourcepub fn lock_pi(&self) -> Result<(), TryAgainError>
pub fn lock_pi(&self) -> Result<(), TryAgainError>
See FUTEX_LOCK_PI
in the Linux futex man page.
Sourcepub fn lock_pi_until(&self, timeout: impl Timeout) -> Result<(), TimedLockError>
pub fn lock_pi_until(&self, timeout: impl Timeout) -> Result<(), TimedLockError>
See FUTEX_LOCK_PI
in the Linux futex man page.
Sourcepub fn trylock_pi(&self) -> Result<(), TryAgainError>
pub fn trylock_pi(&self) -> Result<(), TryAgainError>
See FUTEX_TRYLOCK_PI
in the Linux futex man page.
Sourcepub fn unlock_pi(&self)
pub fn unlock_pi(&self)
See FUTEX_UNLOCK_PI
in the Linux futex man page.