mirror of
https://github.com/denoland/deno.git
synced 2025-07-30 08:34:35 +00:00
refactor: worker is no longer a resource (#3290)
This commit is contained in:
parent
d586f119fa
commit
335e8bd33c
7 changed files with 153 additions and 142 deletions
|
@ -223,8 +223,10 @@ impl TsCompiler {
|
|||
|
||||
/// Create a new V8 worker with snapshot of TS compiler and setup compiler's runtime.
|
||||
fn setup_worker(global_state: ThreadSafeGlobalState) -> Worker {
|
||||
let worker_state = ThreadSafeState::new(global_state.clone(), None, true)
|
||||
.expect("Unable to create worker state");
|
||||
let (int, ext) = ThreadSafeState::create_channels();
|
||||
let worker_state =
|
||||
ThreadSafeState::new(global_state.clone(), None, true, int)
|
||||
.expect("Unable to create worker state");
|
||||
|
||||
// Count how many times we start the compiler worker.
|
||||
global_state
|
||||
|
@ -236,6 +238,7 @@ impl TsCompiler {
|
|||
"TS".to_string(),
|
||||
startup_data::compiler_isolate_init(),
|
||||
worker_state,
|
||||
ext,
|
||||
);
|
||||
worker.execute("denoMain()").unwrap();
|
||||
worker.execute("workerMain()").unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue