update UninitCell::write call in arch::wasm too

This commit is contained in:
Hailey Somerville 2023-09-14 13:59:24 +10:00
parent 3a1ed823f8
commit b9d4b18f14

View File

@ -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());
}
}