[][src]Struct linux_futex::PiFutex

#[repr(transparent)]pub struct PiFutex<Scope> {
    pub value: AtomicI32,
    // some fields omitted
}

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

impl<S> Debug for PiFutex<S>[src]

impl<S> Default for PiFutex<S>[src]

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.