Struct linux_futex::PiFutex
source · #[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>
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.
Trait Implementations§
Auto Trait Implementations§
impl<Scope> !Freeze for PiFutex<Scope>
impl<Scope> RefUnwindSafe for PiFutex<Scope>where
Scope: RefUnwindSafe,
impl<Scope> Send for PiFutex<Scope>where
Scope: Send,
impl<Scope> Sync for PiFutex<Scope>where
Scope: Sync,
impl<Scope> Unpin for PiFutex<Scope>where
Scope: Unpin,
impl<Scope> UnwindSafe for PiFutex<Scope>where
Scope: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more