pub struct FastMutexGuard<'a, T> { /* private fields */ }
Expand description
A RAII scoped guard for the inner data protected by the mutex. Once this guard is given out, the protected data may be safely mutated by the caller as we guarantee exclusive access via Windows Kernel Mutex primitives.
When this structure is dropped (falls out of scope), the lock will be unlocked.
§IRQL
Access to the data within this guard must be done at APC_LEVEL
It is the callers responsible to
manage IRQL whilst using the FastMutex
. On calling FastMutex::lock
, the IRQL will automatically
be raised to APC_LEVEL
.
If you wish to manually drop the lock with a safety check, call the function Self::drop_safe
.
§Kernel panic
Raising the IRQL above safe limits whilst using the mutex will cause a Kernel Panic if not appropriately handled.
Implementations§
Source§impl<T> FastMutexGuard<'_, T>
impl<T> FastMutexGuard<'_, T>
Sourcepub fn drop_safe(&mut self) -> Result<(), DriverMutexError>
pub fn drop_safe(&mut self) -> Result<(), DriverMutexError>
Trait Implementations§
Source§impl<T> Deref for FastMutexGuard<'_, T>
impl<T> Deref for FastMutexGuard<'_, T>
Source§impl<T> DerefMut for FastMutexGuard<'_, T>
impl<T> DerefMut for FastMutexGuard<'_, T>
Source§impl<T> Display for FastMutexGuard<'_, T>where
T: Display,
impl<T> Display for FastMutexGuard<'_, T>where
T: Display,
Auto Trait Implementations§
impl<'a, T> Freeze for FastMutexGuard<'a, T>
impl<'a, T> RefUnwindSafe for FastMutexGuard<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for FastMutexGuard<'a, T>
impl<'a, T> Sync for FastMutexGuard<'a, T>
impl<'a, T> Unpin for FastMutexGuard<'a, T>
impl<'a, T> UnwindSafe for FastMutexGuard<'a, T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more