summaryrefslogtreecommitdiff
path: root/runtime/web_worker.rs
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2021-07-06 19:42:52 +0200
committerGitHub <noreply@github.com>2021-07-06 19:42:52 +0200
commitbdfad23dd012d0c3226b466544e86109da18d09c (patch)
treef59bfc463f29047df80c48abbe299e55a16b8622 /runtime/web_worker.rs
parent672a88f2727286233ab904e23a9145aa5563a834 (diff)
feat: support SharedArrayBuffer sharing between workers (#11040)
This commit adds support for sharing SABs between workers.
Diffstat (limited to 'runtime/web_worker.rs')
-rw-r--r--runtime/web_worker.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs
index 55e107002..f8aadf4c2 100644
--- a/runtime/web_worker.rs
+++ b/runtime/web_worker.rs
@@ -28,6 +28,7 @@ use deno_core::ModuleId;
use deno_core::ModuleLoader;
use deno_core::ModuleSpecifier;
use deno_core::RuntimeOptions;
+use deno_core::SharedArrayBufferStore;
use deno_web::create_entangled_message_port;
use deno_web::BlobStore;
use deno_web::MessagePort;
@@ -269,6 +270,7 @@ pub struct WebWorkerOptions {
pub get_error_class_fn: Option<GetErrorClassFn>,
pub blob_store: BlobStore,
pub broadcast_channel: InMemoryBroadcastChannel,
+ pub shared_array_buffer_store: Option<SharedArrayBufferStore>,
}
impl WebWorker {
@@ -351,6 +353,7 @@ impl WebWorker {
startup_snapshot: Some(js::deno_isolate_init()),
js_error_create_fn: options.js_error_create_fn.clone(),
get_error_class_fn: options.get_error_class_fn,
+ shared_array_buffer_store: options.shared_array_buffer_store.clone(),
extensions,
..Default::default()
});