Fix unsafe operation of wasm32::memory_atomic_notify

This commit is contained in:
chansuke 2020-10-24 18:14:17 +09:00
parent de87ae7961
commit d147f78e36

View File

@ -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"
}
}