From b9d4b18f14ad477c4b554498282ac467ff9cb823 Mon Sep 17 00:00:00 2001 From: Hailey Somerville Date: Thu, 14 Sep 2023 13:59:24 +1000 Subject: [PATCH] update UninitCell::write call in arch::wasm too --- embassy-executor/src/arch/wasm.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/embassy-executor/src/arch/wasm.rs b/embassy-executor/src/arch/wasm.rs index 934fd69e..15aed867 100644 --- a/embassy-executor/src/arch/wasm.rs +++ b/embassy-executor/src/arch/wasm.rs @@ -73,9 +73,10 @@ mod thread { pub fn start(&'static mut self, init: impl FnOnce(Spawner)) { unsafe { let executor = &self.inner; - self.ctx.closure.write(Closure::new(move |_| { + let future = Closure::new(move |_| { executor.poll(); - })); + }); + self.ctx.closure.write_in_place(|| future); init(self.inner.spawner()); } }