[][src]Trait sunrise_kernel::sync::Lock

pub trait Lock<'a, GUARD: 'a> {
    fn lock(&'a self) -> GUARD;
}

Abstraction around various kind of locks.

Some functions need to take a Lock and/or a LockGuard as argument, but don't really care about the kind of lock (schedule comes to mind). This trait is a simple abstraction around this concept.

Required methods

fn lock(&'a self) -> GUARD

Locks the lock until the returned guard is dropped. The actual semantics is up to the underlying lock. This trait does not make any guarantee about anything like memory ordering or whatnot. Please read the documentation of the underlying lock type.

Loading content...

Implementors

impl<'a, T> Lock<'a, MutexGuard<'a, T>> for SpinLock<T>[src]

impl<'a, T> Lock<'a, SpinLockIRQGuard<'a, T>> for SpinLockIRQ<T>[src]

impl<'a, T> Lock<'a, RwLockReadGuard<'a, T>> for SpinRwLock<T>[src]

impl<'a, T> Lock<'a, RwLockWriteGuard<'a, T>> for SpinRwLock<T>[src]

Loading content...