use core::ops::DerefMut;
use super::{Mutex, MutexGuard};
use crate::inner::raw::{self, Key};
use crate::lock::{Lock, Wait};
impl<T: ?Sized, L: Lock, Ws: Wait, Wq: Wait> Mutex<T, L, Ws, Wq> {
pub unsafe fn lock_with_local_unchecked<N>(&self, node: Key<N>) -> MutexGuard<'_, T, L, Ws, Wq>
where
N: DerefMut<Target = raw::MutexNode<L>>,
{
self.lock(|f| unsafe { self.queue.lock_with_local_then_unchecked(node, |()| f(self)) })
}
}