ensure clean shutdown of all threads running JS

This commit is contained in:
Gregory Terzian 2020-06-24 15:07:48 +08:00
parent 0b61cfc3ae
commit 44ebca72da
25 changed files with 565 additions and 232 deletions

View file

@ -1544,7 +1544,10 @@ impl XMLHttpRequest {
if let Some(script_port) = script_port {
loop {
global.process_event(script_port.recv().unwrap());
if !global.process_event(script_port.recv().unwrap()) {
// We're exiting.
return Err(Error::Abort);
}
let context = context.lock().unwrap();
let sync_status = context.sync_status.borrow();
if let Some(ref status) = *sync_status {