pub struct L3Sync<T> {
data: SyncUnsafeCell<T>,
}
Expand description
L3Sync is like RefCell, instead of counting the reference numbers, we check that the interrupt must be disabled. e.g. epilogue queue
TODO: implement reference counting to make sure the sync model is followed
Fields§
§data: SyncUnsafeCell<T>
Implementations§
Source§impl<T> L3Sync<T>
impl<T> L3Sync<T>
pub const fn new(data: T) -> Self
Sourcepub fn l3_get_ref(&self) -> &T
pub fn l3_get_ref(&self) -> &T
get a readonly reference to the protected data. It should be fine to get a read only ref without masking interrupts but we haven’t implemented reference counting yet so …
Sourcepub fn l3_get_ref_mut(&self) -> &mut T
pub fn l3_get_ref_mut(&self) -> &mut T
get a mutable reference to the protected data. will panic if called with interrupt enabled
Sourcepub unsafe fn l3_get_ref_mut_unchecked(&self) -> &mut T
pub unsafe fn l3_get_ref_mut_unchecked(&self) -> &mut T
get a mutable reference without checking sync/borrow conditions.