[−][src]Struct irq::LockHalf
One half of a PriorityLock
.
This can be obtained via PriorityLock::split
.
Methods
impl<'a, T> LockHalf<'a, T, PLow>
[src]
pub fn lock(&mut self) -> LockGuard<'a, T, PLow>
[src]
Acquires the lock, granting access to T
.
This is meant to be called from a low-priority context and may be preempted by code owning the high-priority half of the lock. If the lock is already taken, this will block until it is released again.
impl<'a, T> LockHalf<'a, T, PHigh>
[src]
pub fn try_lock(&mut self) -> Result<LockGuard<'a, T, PHigh>, Deadlock>
[src]
Tries to acquire the lock, granting access to T
.
This is meant to be called from a high-priority context that may preempt code owning the low-priority half of the lock.
Errors
This operation can fail when the low-priority code already holds the lock, and is being
preempted by the code calling try_lock
. There is no general way to recover from this.
If this is an issue, consider using a different way of sharing data between interrupts (see
the PriorityLock
documentation for guidance).
Trait Implementations
Auto Trait Implementations
impl<'a, T, P> !Send for LockHalf<'a, T, P>
impl<'a, T, P> !Sync for LockHalf<'a, T, P>
impl<'a, T, P> Unpin for LockHalf<'a, T, P> where
P: Unpin,
P: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,