pub struct RtMutex<T> { /* private fields */ }Available on crate feature
std only.Expand description
A blocking mutex with priority inheritance (RT-CORBA §5.6).
The lock is granted in priority order: when the owner releases, it
goes to the highest-priority waiting thread (not FIFO). The effective
owner priority (base raised to the highest waiter) is queryable via
effective_holder_priority
— a runtime integration can use it to track the OS priority of the owner
thread.
Implementations§
Source§impl<T> RtMutex<T>
impl<T> RtMutex<T>
Sourcepub fn lock(&self, my_priority: Priority) -> RtMutexGuard<'_, T>
pub fn lock(&self, my_priority: Priority) -> RtMutexGuard<'_, T>
Locks the mutex for a caller with priority my_priority.
Blocks in priority order (Condvar, no spin) until it is its
turn.
§Panics
On a poisoned internal lock.
Sourcepub fn try_lock(&self, my_priority: Priority) -> Option<RtMutexGuard<'_, T>>
pub fn try_lock(&self, my_priority: Priority) -> Option<RtMutexGuard<'_, T>>
Sourcepub fn effective_holder_priority(&self) -> Option<Priority>
pub fn effective_holder_priority(&self) -> Option<Priority>
Effective priority of the current owner: its base, raised to
the highest waiting priority (priority inheritance). None if
nobody currently holds the lock.
§Panics
On a poisoned internal lock.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for RtMutex<T>
impl<T> RefUnwindSafe for RtMutex<T>
impl<T> Send for RtMutex<T>where
T: Send,
impl<T> Sync for RtMutex<T>where
T: Send,
impl<T> Unpin for RtMutex<T>where
T: Unpin,
impl<T> UnsafeUnpin for RtMutex<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for RtMutex<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more