pub struct InitData<T: Send>(pub UnsafeCell<Option<T>>);
Expand description
The holder of data that is to be shared with the target thread.
§Safety
The Option is kept in an UnsafeCell, and it’s use governed by an atomic in the TaskData
below. When the task is not initialized/not running, this should be set to None. It will be
set to Some in a critical section during startup, where the critical section provides the
barrier. Once the atomic is set to true, the thread owns this data.
The Send constraint force arguments passed to threads to be Send.
Tuple Fields§
§0: UnsafeCell<Option<T>>
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for InitData<T>
impl<T> !RefUnwindSafe for InitData<T>
impl<T> Send for InitData<T>
impl<T> Unpin for InitData<T>where
T: Unpin,
impl<T> UnwindSafe for InitData<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