Skip to main content

IrqWaitCell

Struct IrqWaitCell 

Source
pub struct IrqWaitCell { /* private fields */ }
Expand description

Pending-bit plus single-waiter hard-IRQ event cell.

Implementations§

Source§

impl IrqWaitCell

Source

pub const fn new() -> Self

Creates an empty notification cell.

Source

pub fn register<'cell>( &'cell self, registration: &IrqWaitRegistration, ) -> IrqRegisterResult<'cell>

Registers one stable waiter, consuming an earlier IRQ when present.

Source

pub fn notify(&self) -> IrqNotifyResult

Wakes the sole registered thread or publishes one coalesced pending bit.

This operation performs a bounded number of atomics and at most one trusted direct wake. After repeated contention, it atomically installs the sticky pending state and may retain one harmless extra service pass after waking the displaced waiter. It never scans a wait queue or allocates.

The whole claim-to-release section runs non-preemptible, mirroring Linux’s irq_work execution boundary: hard IRQ context is inherently non-preemptible, and ordinary task context enters a preemption scope, matching how irq_workd disables migration around the claim. This bounds how long a draining waiter can observe a Notifying claim.

Source

pub fn is_pending(&self) -> bool

Reports whether an IRQ is coalesced for the next registration.

Trait Implementations§

Source§

impl Debug for IrqWaitCell

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for IrqWaitCell

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for IrqWaitCell

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.