use crate::utils::{SpinLock, SpinLockGuard};
pub(crate) struct NeverWaitLock<T: ?Sized> {
inner: SpinLock<T>,
}
impl<T: ?Sized> NeverWaitLock<T> {
pub(crate) const fn new(value: T) -> Self
where
T: Sized,
{
Self {
inner: SpinLock::new(value),
}
}
pub(crate) fn try_lock(&self) -> Option<SpinLockGuard<T>> {
self.inner.try_lock()
}
}