pub struct CpuLocal<T>(Vec<T>);
Expand description
Encapsulates per-CPU value.
T
need to implement Send for this type to implement Send and Sync because its value
created by one thread then access from another thread.
Use RefCell if you need interior mutability but it will make that value not safe to access from any interrupt handler. You can’t use mutex here because once the thread is pinned it cannot go to sleep.
Tuple Fields§
§0: Vec<T>
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for CpuLocal<T>
impl<T> RefUnwindSafe for CpuLocal<T>where
T: RefUnwindSafe,
impl<T> Unpin for CpuLocal<T>where
T: Unpin,
impl<T> UnwindSafe for CpuLocal<T>where
T: UnwindSafe,
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