aboutsummaryrefslogtreecommitdiff
path: root/embassy-executor/src/arch/wasm.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-executor/src/arch/wasm.rs')
-rw-r--r--embassy-executor/src/arch/wasm.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/embassy-executor/src/arch/wasm.rs b/embassy-executor/src/arch/wasm.rs
index 934fd69e5..15aed867a 100644
--- a/embassy-executor/src/arch/wasm.rs
+++ b/embassy-executor/src/arch/wasm.rs
@@ -73,9 +73,10 @@ mod thread {
73 pub fn start(&'static mut self, init: impl FnOnce(Spawner)) { 73 pub fn start(&'static mut self, init: impl FnOnce(Spawner)) {
74 unsafe { 74 unsafe {
75 let executor = &self.inner; 75 let executor = &self.inner;
76 self.ctx.closure.write(Closure::new(move |_| { 76 let future = Closure::new(move |_| {
77 executor.poll(); 77 executor.poll();
78 })); 78 });
79 self.ctx.closure.write_in_place(|| future);
79 init(self.inner.spawner()); 80 init(self.inner.spawner());
80 } 81 }
81 } 82 }