#[repr(C)]pub struct ThreadRepr { /* private fields */ }
Expand description
Base type for a thread object.
Implementations§
Source§impl ThreadRepr
impl ThreadRepr
pub fn get_state(&self) -> ExecutionState
pub fn get_code(&self) -> u64
pub fn set_state(&self, state: ExecutionState, code: u64) -> ExecutionState
Sourcepub fn waitable(&self, state: ExecutionState) -> ThreadSyncSleep
pub fn waitable(&self, state: ExecutionState) -> ThreadSyncSleep
Create a ThreadSyncSleep that will wait until the thread’s state matches state
.
Sourcepub fn waitable_until_not(&self, state: ExecutionState) -> ThreadSyncSleep
pub fn waitable_until_not(&self, state: ExecutionState) -> ThreadSyncSleep
Create a ThreadSyncSleep that will wait until the thread’s state is not state
.
Sourcepub fn wait(
&self,
expected: ExecutionState,
timeout: Option<Duration>,
) -> Option<(ExecutionState, u64)>
pub fn wait( &self, expected: ExecutionState, timeout: Option<Duration>, ) -> Option<(ExecutionState, u64)>
Wait for a thread’s status to change, optionally timing out. Return value is None if timeout occurs, or Some((ExecutionState, code)) otherwise.
Sourcepub fn wait_until(
&self,
target: ExecutionState,
timeout: Option<Duration>,
) -> Option<(ExecutionState, u64)>
pub fn wait_until( &self, target: ExecutionState, timeout: Option<Duration>, ) -> Option<(ExecutionState, u64)>
Wait for a thread’s status reach a target value, or exited, optionally timing out. The actual execution state of the thread is returned.
Trait Implementations§
Source§impl Default for ThreadRepr
impl Default for ThreadRepr
Source§fn default() -> ThreadRepr
fn default() -> ThreadRepr
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ThreadRepr
impl ObjSafe for ThreadRepr
impl RefUnwindSafe for ThreadRepr
impl Send for ThreadRepr
impl Sync for ThreadRepr
impl Unpin for ThreadRepr
impl UnwindSafe for ThreadRepr
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