[−][src]Struct linux_futex::PiFutex
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: AtomicI32
Implementations
impl<S> PiFutex<S>
[src]
pub const fn new(value: i32) -> Self
[src]
Create a new PiFutex
with an initial value.
pub const WAITERS: i32
[src]
The FUTEX_WAITERS
bit that indicates there are threads waiting.
pub const OWNER_DIED: i32
[src]
The FUTEX_OWNER_DIED
bit that indicates the owning thread died.
pub const TID_MASK: i32
[src]
The bits that are used for storing the thread id (FUTEX_TID_MASK
).
impl<S: Scope> PiFutex<S>
[src]
pub fn lock_pi(&self) -> Result<(), TryAgainError>
[src]
See FUTEX_LOCK_PI
in the Linux futex man page.
pub fn lock_pi_until(&self, timeout: Instant) -> Result<(), TimedLockError>
[src]
See FUTEX_LOCK_PI
in the Linux futex man page.
pub fn trylock_pi(&self) -> Result<(), TryAgainError>
[src]
See FUTEX_TRYLOCK_PI
in the Linux futex man page.
pub fn unlock_pi(&self)
[src]
See FUTEX_UNLOCK_PI
in the Linux futex man page.
Trait Implementations
Auto Trait Implementations
impl<Scope> RefUnwindSafe for PiFutex<Scope> where
Scope: RefUnwindSafe,
Scope: RefUnwindSafe,
impl<Scope> Send for PiFutex<Scope> where
Scope: Send,
Scope: Send,
impl<Scope> Sync for PiFutex<Scope> where
Scope: Sync,
Scope: Sync,
impl<Scope> Unpin for PiFutex<Scope> where
Scope: Unpin,
Scope: Unpin,
impl<Scope> UnwindSafe for PiFutex<Scope> where
Scope: UnwindSafe,
Scope: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,