Lines Matching full:guard
3 //! Generic kernel lock and guard.
5 //! It contains a generic Rust lock and guard that allow for different backends (e.g., mutexes,
124 pub fn lock(&self) -> Guard<'_, T, B> { in lock()
129 unsafe { Guard::new(self, state) } in lock()
133 /// A lock guard.
136 /// when a guard goes out of scope. It also provides a safe and convenient way to access the data
138 #[must_use = "the lock unlocks immediately when the guard is unused"]
139 pub struct Guard<'a, T: ?Sized, B: Backend> { struct
145 // SAFETY: `Guard` is sync when the data protected by the lock is also sync. argument
146 unsafe impl<T: Sync + ?Sized, B: Backend> Sync for Guard<'_, T, B> {} implementation
148 impl<T: ?Sized, B: Backend> Guard<'_, T, B> { impl
161 impl<T: ?Sized, B: Backend> core::ops::Deref for Guard<'_, T, B> { implementation
170 impl<T: ?Sized, B: Backend> core::ops::DerefMut for Guard<'_, T, B> { implementation
177 impl<T: ?Sized, B: Backend> Drop for Guard<'_, T, B> { implementation
184 impl<'a, T: ?Sized, B: Backend> Guard<'a, T, B> { implementation
185 /// Constructs a new immutable lock guard.