| H A D | lock.rs | 174 pub fn lock(&self) -> Guard<'_, T, B> { in lock() 179 unsafe { Guard::new(self, state) } 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)) } 201 pub struct Guard<'a, T: ?Sized, B: Backend> { 207 // SAFETY: `Guard` is sync when the data protected by the lock is also sync. implementation 208 unsafe impl<T: Sync + ?Sized, B: Backend> Sync for Guard<'_, T, B> {} 210 impl<'a, T: ?Sized, B: Backend> Guard<'a, T, B> { 215 /// The following example shows how to use [`Guard::lock_ref()`] to assert the corresponding 219 /// # use kernel::{new_spinlock, sync::lock::{Backend, Guard, Loc 198 pub struct Guard<'a, T: ?Sized, B: Backend> { global() struct 200 stateGuard global() argument 204 _not_sendGuard global() argument 205 unsafe impl<T: Sync + ?Sized, B: Backend> Sync for Guard<'_, 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...] |