diff options
Diffstat (limited to 'runtime/web_worker.rs')
-rw-r--r-- | runtime/web_worker.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs index f5df2f58b..24306fab5 100644 --- a/runtime/web_worker.rs +++ b/runtime/web_worker.rs @@ -38,6 +38,7 @@ use std::cell::RefCell; use std::fmt; use std::rc::Rc; use std::sync::atomic::AtomicBool; +use std::sync::atomic::AtomicI32; use std::sync::atomic::Ordering; use std::sync::Arc; use std::task::Context; @@ -323,6 +324,7 @@ pub struct WebWorkerOptions { pub broadcast_channel: InMemoryBroadcastChannel, pub shared_array_buffer_store: Option<SharedArrayBufferStore>, pub compiled_wasm_module_store: Option<CompiledWasmModuleStore>, + pub maybe_exit_code: Option<Arc<AtomicI32>>, } impl WebWorker { @@ -408,7 +410,9 @@ impl WebWorker { unstable, options.unsafely_ignore_certificate_errors.clone(), ), - ops::os::init(), + ops::os::init(Some(options.maybe_exit_code.expect( + "Worker has access to OS ops but exit code was not passed.", + ))), ops::permissions::init(), ops::process::init(), ops::signal::init(), |