Trait kernel::sync::Lock[][src]

pub trait Lock {
    type Inner: ?Sized;
    fn lock_noguard(&self);
unsafe fn unlock(&self);
fn locked_data(&self) -> &UnsafeCell<Self::Inner>; }
Expand description

A generic mutual exclusion primitive.

Guard is written such that any mutual exclusion primitive that can implement this trait can also benefit from having an automatic way to unlock itself.

Associated Types

The type of the data protected by the lock.

Required methods

Acquires the lock, making the caller its owner.

Releases the lock, giving up ownership of the lock.

Safety

It must only be called by the current owner of the lock.

Returns the data protected by the lock.

Implementors