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§

Create a new PiFutex with an initial value.

The FUTEX_WAITERS bit that indicates there are threads waiting.

The FUTEX_OWNER_DIED bit that indicates the owning thread died.

The bits that are used for storing the thread id (FUTEX_TID_MASK).

See FUTEX_LOCK_PI in the Linux futex man page.

See FUTEX_LOCK_PI in the Linux futex man page.

See FUTEX_TRYLOCK_PI in the Linux futex man page.

See FUTEX_UNLOCK_PI in the Linux futex man page.

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.