Skip to main content

InterruptibleMutexExt

Trait InterruptibleMutexExt 

Source
pub trait InterruptibleMutexExt<T>
where T: ?Sized,
{ // Required method fn lock_interruptible<F>( &self, should_interrupt: F, ) -> Result<MutexGuard<'_, RawMutex, T>, PiMutexLockInterrupted> where F: FnMut() -> bool; }
Expand description

Linux rtmutex-style interruptible acquisition for a PI mutex.

Required Methods§

Source

fn lock_interruptible<F>( &self, should_interrupt: F, ) -> Result<MutexGuard<'_, RawMutex, T>, PiMutexLockInterrupted>
where F: FnMut() -> bool,

Acquires this mutex unless should_interrupt becomes true while the caller remains queued.

A published ownerless handoff wins over interruption. The returned guard therefore has the same acquire-before-signal ordering as Linux mutex_lock_interruptible() under PREEMPT_RT. The interruption publisher must also wake the waiting task, just as Linux signal_wake_up_state() sets TIF_SIGPENDING and wakes TASK_INTERRUPTIBLE; this predicate is not polled while the task is asleep.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> InterruptibleMutexExt<T> for Mutex<RawMutex, T>
where T: ?Sized,

Source§

fn lock_interruptible<F>( &self, should_interrupt: F, ) -> Result<MutexGuard<'_, RawMutex, T>, PiMutexLockInterrupted>
where F: FnMut() -> bool,

Implementors§