use std::cell::UnsafeCell;
pub struct SyncUnsafeCell<T>(UnsafeCell<T>);
unsafe impl<T: Sync> Sync for SyncUnsafeCell<T> {}
impl<T> SyncUnsafeCell<T> {
pub(crate) const fn new(value: T) -> Self {
Self(UnsafeCell::new(value))
}
#[inline]
pub(crate) unsafe fn get(&self) -> &T {
unsafe { &*self.0.get() }
}
#[inline]
pub unsafe fn get_mut(&self) -> &mut T {
unsafe { &mut *self.0.get() }
}
}