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.