pub struct ThreadConditions {
inner: Arc<NotifyMap>,
}Expand description
HashMap of Waiters for the Thread/Notify opcodes
Fields§
§inner: Arc<NotifyMap>Implementations§
Source§impl ThreadConditions
impl ThreadConditions
Sourcepub unsafe fn do_wait(
&mut self,
dst: NotifyLocation,
expected: ExpectedValue,
timeout: Option<Duration>,
) -> Result<u32, WaiterError>
pub unsafe fn do_wait( &mut self, dst: NotifyLocation, expected: ExpectedValue, timeout: Option<Duration>, ) -> Result<u32, WaiterError>
Add current thread to the waiter hash
§Safety
If expected is ExpectedValue::None, no safety requirements.
The notify location must have a valid base address that belongs to a memory,
and the address must be a valid offset within that memory. The offset also
must be properly aligned for the expected value type; either 4-byte aligned for
ExpectedValue::U32 or 8-byte aligned for ExpectedValue::U64.
Sourcepub fn wake_all_atomic_waiters(&self)
pub fn wake_all_atomic_waiters(&self)
Wake all the waiters, without marking them as notified.
Useful on shutdown to resume execution in all waiters.
Sourcepub fn disable_atomics(&self)
pub fn disable_atomics(&self)
Disable the use of atomics, leading to all atomic waits failing with an error, which leads to a Webassembly trap.
Useful for force-closing instances that keep waiting on atomics.
Sourcepub fn downgrade(&self) -> ThreadConditionsHandle
pub fn downgrade(&self) -> ThreadConditionsHandle
Get a weak handle to this ThreadConditions instance.
See ThreadConditionsHandle for more information.
Trait Implementations§
Source§impl Clone for ThreadConditions
impl Clone for ThreadConditions
Auto Trait Implementations§
impl Freeze for ThreadConditions
impl !RefUnwindSafe for ThreadConditions
impl Send for ThreadConditions
impl Sync for ThreadConditions
impl Unpin for ThreadConditions
impl !UnwindSafe for ThreadConditions
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§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