mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-15 12:39:31 +03:00
Fix unsafe operation of wasm32::memory_atomic_notify
This commit is contained in:
@@ -52,8 +52,9 @@ pub unsafe fn notify_one(&self) {
|
||||
|
||||
#[inline]
|
||||
pub unsafe fn notify_all(&self) {
|
||||
self.cnt.fetch_add(1, SeqCst);
|
||||
// SAFETY: memory_atomic_notify()is always valid
|
||||
unsafe {
|
||||
self.cnt.fetch_add(1, SeqCst);
|
||||
wasm32::memory_atomic_notify(self.ptr(), u32::MAX); // -1 == "wake everyone"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user