mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
ensure clean shutdown of all threads running JS
This commit is contained in:
parent
0b61cfc3ae
commit
44ebca72da
25 changed files with 565 additions and 232 deletions
|
@ -125,6 +125,7 @@ impl Worker {
|
|||
let init = prepare_workerscope_init(global, Some(devtools_sender), Some(worker_id));
|
||||
|
||||
let (control_sender, control_receiver) = unbounded();
|
||||
let (context_sender, context_receiver) = unbounded();
|
||||
|
||||
let join_handle = DedicatedWorkerGlobalScope::run_worker_scope(
|
||||
init,
|
||||
|
@ -142,9 +143,14 @@ impl Worker {
|
|||
browsing_context,
|
||||
global.wgpu_id_hub(),
|
||||
control_receiver,
|
||||
context_sender,
|
||||
);
|
||||
|
||||
global.track_worker(closing, join_handle, control_sender);
|
||||
let context = context_receiver
|
||||
.recv()
|
||||
.expect("Couldn't receive a context for worker.");
|
||||
|
||||
global.track_worker(closing, join_handle, control_sender, context);
|
||||
|
||||
Ok(worker)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue