feat: support SharedArrayBuffer sharing between workers (#11040)

This commit adds support for sharing SABs between workers.
This commit is contained in:
Luca Casonato 2021-07-06 19:42:52 +02:00 committed by GitHub
parent 672a88f272
commit bdfad23dd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 152 additions and 0 deletions

View file

@ -123,6 +123,9 @@ fn create_web_worker_callback(
get_error_class_fn: Some(&crate::errors::get_error_class_name),
blob_store: program_state.blob_store.clone(),
broadcast_channel: program_state.broadcast_channel.clone(),
shared_array_buffer_store: Some(
program_state.shared_array_buffer_store.clone(),
),
};
let (mut worker, external_handle) = WebWorker::from_options(
@ -209,6 +212,9 @@ pub fn create_main_worker(
}),
blob_store: program_state.blob_store.clone(),
broadcast_channel: program_state.broadcast_channel.clone(),
shared_array_buffer_store: Some(
program_state.shared_array_buffer_store.clone(),
),
};
let mut worker = MainWorker::from_options(main_module, permissions, &options);