Fix unsafe operation of wasm32::memory_atomic_notify
This commit is contained in:
parent
de87ae7961
commit
d147f78e36
1 changed files with 2 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue