Struct wasmer_wasix::os::task::thread::WasiThreadHandle
source · pub struct WasiThreadHandle {
protected: Arc<WasiThreadHandleProtected>,
}
Fields§
§protected: Arc<WasiThreadHandleProtected>
Implementations§
source§impl WasiThreadHandle
impl WasiThreadHandle
pub(crate) fn new( thread: WasiThread, inner: &Arc<(Mutex<WasiProcessInner>, Condvar)>, ) -> WasiThreadHandle
pub fn id(&self) -> WasiThreadId
pub fn as_thread(&self) -> WasiThread
Methods from Deref<Target = WasiThread>§
pub fn id(&self) -> WasiThreadId
sourcepub fn thread_start_type(&self) -> ThreadStartType
pub fn thread_start_type(&self) -> ThreadStartType
Gets the thread start type for this thread
sourcepub(crate) fn has_rewind_of_type(&self, type_: HandleRewindType) -> bool
pub(crate) fn has_rewind_of_type(&self, type_: HandleRewindType) -> bool
Returns true if a rewind of a particular type has been queued for processed by a rewind operation
sourcepub(crate) fn set_deep_sleeping(&self, val: bool)
pub(crate) fn set_deep_sleeping(&self, val: bool)
Sets a flag that tells others if this thread is currently deep sleeping
sourcepub(crate) fn is_deep_sleeping(&self) -> bool
pub(crate) fn is_deep_sleeping(&self) -> bool
Reads a flag that determines if this thread is currently deep sleeping
sourcepub(crate) fn set_checkpointing(&self, val: bool)
pub(crate) fn set_checkpointing(&self, val: bool)
Sets a flag that tells others that this thread is currently check pointing itself
sourcepub(crate) fn is_check_pointing(&self) -> bool
pub(crate) fn is_check_pointing(&self) -> bool
Reads a flag that determines if this thread is currently check pointing itself or not
sourcepub(crate) fn memory_layout(&self) -> &WasiMemoryLayout
pub(crate) fn memory_layout(&self) -> &WasiMemoryLayout
Gets the memory layout for this thread
sourcepub fn pid(&self) -> WasiProcessId
pub fn pid(&self) -> WasiProcessId
Returns the process ID
sourcepub fn tid(&self) -> WasiThreadId
pub fn tid(&self) -> WasiThreadId
Returns the thread ID
sourcepub fn join_handle(&self) -> TaskJoinHandle
pub fn join_handle(&self) -> TaskJoinHandle
Get a join handle to watch the task status.
pub fn signals(&self) -> &Mutex<(Vec<Signal>, Vec<Waker>)>
pub fn set_status_running(&self)
sourcepub fn set_or_get_exit_code_for_signal(&self, sig: Signal) -> ExitCode
pub fn set_or_get_exit_code_for_signal(&self, sig: Signal) -> ExitCode
Gets or sets the exit code based of a signal that was received Note: if the exit code was already set earlier this method will just return that earlier set exit code
sourcepub fn set_status_finished(&self, res: Result<ExitCode, WasiRuntimeError>)
pub fn set_status_finished(&self, res: Result<ExitCode, WasiRuntimeError>)
Marks the thread as finished (which will cause anyone that joined on it to wake up)
sourcepub async fn join(&self) -> Result<ExitCode, Arc<WasiRuntimeError>>
pub async fn join(&self) -> Result<ExitCode, Arc<WasiRuntimeError>>
Waits until the thread is finished or the timeout is reached
sourcepub fn try_join(&self) -> Option<Result<ExitCode, Arc<WasiRuntimeError>>>
pub fn try_join(&self) -> Option<Result<ExitCode, Arc<WasiRuntimeError>>>
Attempts to join on the thread
sourcepub fn has_signal(&self, signals: &[Signal]) -> bool
pub fn has_signal(&self, signals: &[Signal]) -> bool
Returns all the signals that are waiting to be processed
sourcepub async fn wait_for_signal(&self)
pub async fn wait_for_signal(&self)
Waits for a signal to arrive
sourcepub fn pop_signals_or_subscribe(&self, waker: &Waker) -> Option<Vec<Signal>>
pub fn pop_signals_or_subscribe(&self, waker: &Waker) -> Option<Vec<Signal>>
Returns all the signals that are waiting to be processed
sourcepub fn has_signals_or_subscribe(&self, waker: &Waker) -> bool
pub fn has_signals_or_subscribe(&self, waker: &Waker) -> bool
Returns all the signals that are waiting to be processed
sourcepub fn pop_signals(&self) -> Vec<Signal>
pub fn pop_signals(&self) -> Vec<Signal>
Returns all the signals that are waiting to be processed
sourcepub fn add_snapshot(
&self,
memory_stack: &[u8],
memory_stack_corrected: &[u8],
hash: u128,
rewind_stack: &[u8],
store_data: &[u8],
)
pub fn add_snapshot( &self, memory_stack: &[u8], memory_stack_corrected: &[u8], hash: u128, rewind_stack: &[u8], store_data: &[u8], )
Adds a stack snapshot and removes dead ones
sourcepub fn get_snapshot(&self, hash: u128) -> Option<(BytesMut, Bytes, Bytes)>
pub fn get_snapshot(&self, hash: u128) -> Option<(BytesMut, Bytes, Bytes)>
Gets a snapshot that was previously addedf
pub fn copy_stack_from(&self, other: &WasiThread)
Trait Implementations§
source§impl Clone for WasiThreadHandle
impl Clone for WasiThreadHandle
source§fn clone(&self) -> WasiThreadHandle
fn clone(&self) -> WasiThreadHandle
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WasiThreadHandle
impl Debug for WasiThreadHandle
Auto Trait Implementations§
impl Freeze for WasiThreadHandle
impl !RefUnwindSafe for WasiThreadHandle
impl Send for WasiThreadHandle
impl Sync for WasiThreadHandle
impl Unpin for WasiThreadHandle
impl !UnwindSafe for WasiThreadHandle
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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