| H A D | lock.rs | 3 //! Generic kernel lock and guard. 5 //! It contains a generic Rust lock and guard that allow for different backends (e.g., mutexes, 174 pub fn lock(&self) -> Guard<'_, T, B> { in lock() 179 unsafe { Guard::new(self, state) } 184 /// Returns a guard that can be used to access the data protected by the lock if successful. 188 pub fn try_lock(&self) -> Option<Guard<'_, T, B>> { in try_lock() 191 unsafe { B::try_lock(self.state.get()).map(|state| Guard::new(self, state)) } 195 /// A lock guard. 198 /// when a guard goes out of scope. It also provides a safe and convenient way to access the data struct 200 #[must_use = "the lock unlocks immediately when the guard i argument 204 _not_sendGuard global() argument 205 unsafe impl<T: Sync + ?Sized, B: Backend> Sync for Guard<'_, T, B> {} global() implementation 207 impl<'a, T: ?Sized, B: Backend> Guard<'a, T, B> { global() implementation 275 impl<T: ?Sized, B: Backend> core::ops::Deref for Guard<'_, T, B> { global() implementation 284 impl<T: ?Sized, B: Backend> core::ops::DerefMut for Guard<'_, T, B> global() implementation 294 impl<T: ?Sized, B: Backend> Drop for Guard<'_, T, B> { global() implementation 301 impl<'a, T: ?Sized, B: Backend> Guard<'a, T, B> { global() implementation [all...] |