mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
Fix unsafe operation of wasm32::memory_atomic_notify
This commit is contained in:
parent
de87ae7961
commit
d147f78e36
@ -52,8 +52,9 @@ impl Condvar {
|
||||
|
||||
#[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"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user