mirror of
https://github.com/tlsnotary/wasm-bindgen.git
synced 2026-01-10 07:28:00 -05:00
The start function still gets called on every thread in that example because it doesn't actually use wasm multithreading; each thread's instance has it's own separate memory pool and is completely unaware of the other thread. So, attempting to switch it to use a regular start function caused the worker thread to spawn another one, which does likewise, quickly spiralling out of control. It also ended up panicking because, thinking it was the main thread, the code was trying to access `window` inside of a worker.