[][src]Struct irq::LockHalf

pub struct LockHalf<'a, T, P: LockPriority> { /* fields omitted */ }

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

impl<'a, T: Debug, P: Debug + LockPriority> Debug for LockHalf<'a, T, P>[src]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.