mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +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
|
@ -218,6 +218,13 @@ impl OneshotTimers {
|
|||
}
|
||||
|
||||
for timer in timers_to_run {
|
||||
// Since timers can be coalesced together inside a task,
|
||||
// this loop can keep running, including after an interrupt of the JS,
|
||||
// and prevent a clean-shutdown of a JS-running thread.
|
||||
// This check prevents such a situation.
|
||||
if !global.can_continue_running() {
|
||||
return;
|
||||
}
|
||||
let callback = timer.callback;
|
||||
callback.invoke(global, &self.js_timers);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue