diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2019-11-24 07:42:30 -0800 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-11-24 10:42:30 -0500 |
commit | bca23e64339f9b41272e4a01e4c1a86602e5c1e4 (patch) | |
tree | fe72fe56fd0f9ffa8e7392ec1941cce3300915ec /cli/ops/workers.rs | |
parent | 9e97eb287954393615ec89d42e7ca5548ecb0881 (diff) |
refactor: Elevate DenoPermissions lock to top level (#3398)
Diffstat (limited to 'cli/ops/workers.rs')
-rw-r--r-- | cli/ops/workers.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cli/ops/workers.rs b/cli/ops/workers.rs index a03290545..4bde38222 100644 --- a/cli/ops/workers.rs +++ b/cli/ops/workers.rs @@ -142,10 +142,13 @@ fn op_create_worker( let (int, ext) = ThreadSafeState::create_channels(); let child_state = ThreadSafeState::new( state.global_state.clone(), + Some(parent_state.permissions.clone()), // by default share with parent Some(module_specifier.clone()), include_deno_namespace, int, )?; + // TODO: add a new option to make child worker not sharing permissions + // with parent (aka .clone(), requests from child won't reflect in parent) let name = format!("USER-WORKER-{}", specifier); let deno_main_call = format!("denoMain({})", include_deno_namespace); let mut worker = |