diff options
| author | Tyler <[email protected]> | 2023-09-29 20:02:24 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-09-29 20:02:24 -0600 |
| commit | 2f9b59c5cf21f1e2761a9ccefdfd86f0edea829c (patch) | |
| tree | 8964744b4fb753cf98f6f413464106c4d2a72976 /embassy-executor/src/arch/wasm.rs | |
| parent | ce91fb2bfc846570ef543a09396c428d70675245 (diff) | |
| parent | 95b3d9eb3b3657de3d7bc9c04f8fb83eae901640 (diff) | |
Merge branch 'main' into issue-1974-add-sai-driver
Diffstat (limited to 'embassy-executor/src/arch/wasm.rs')
| -rw-r--r-- | embassy-executor/src/arch/wasm.rs | 5 |
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 | } |
