struct ThreadInterruptState {
active_stores: Vec<StoreId>,
current_active_store: AtomicUsize,
current_signal_target_store: Arc<AtomicUsize>,
}Expand description
Thread-related state; only PARTS of this struct are safe to access from within the interrupt handler.
Fields§
§active_stores: Vec<StoreId>We need to maintain a stack of active stores per thread, hence the vec. This should not be touched by the interrupt handler.
current_active_store: AtomicUsizeAlways stores the top entry from active_stores. Needed since a vec is not
safe to access from signal handlers.
current_signal_target_store: Arc<AtomicUsize>Shared state between the thread requesting the interrupt
and the thread running the store’s code. The thread
requesting the interrupt writes the ID of the store it
wants to interrupt to this atomic. The interrupted
thread later checks this value (through its own clone
of the Arc in ThreadInterruptState) against the currently
running store, and traps only if they match, recording the
interrupt otherwise.
Note that mutexes are not safe for use within signal
handlers; only atomics can be safely used.
Auto Trait Implementations§
impl !Freeze for ThreadInterruptState
impl RefUnwindSafe for ThreadInterruptState
impl Send for ThreadInterruptState
impl Sync for ThreadInterruptState
impl Unpin for ThreadInterruptState
impl UnwindSafe for ThreadInterruptState
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more